<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>tending the garden &#187; puppet</title>
	<atom:link href="http://www.chesnok.com/daily/tag/puppet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chesnok.com/daily</link>
	<description>Selena Deckelmann&#039;s blog about postgres, open source and the web.</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:19:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<copyright>2006-2007 </copyright>
	<managingEditor>selenamarie@gmail.com (tending the garden)</managingEditor>
	<webMaster>selenamarie@gmail.com (tending the garden)</webMaster>
	<image>
		<url>http://www.chesnok.com/daily/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>tending the garden</title>
		<link>http://www.chesnok.com/daily</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>a gathering place for all the stray thoughts</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>tending the garden</itunes:author>
	<itunes:owner>
		<itunes:name>tending the garden</itunes:name>
		<itunes:email>selenamarie@gmail.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.chesnok.com/daily/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Puppet Faces: defaults and &#8216;puppet node clean&#8217;</title>
		<link>http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=puppet-faces-defaults-and-puppet-node-clean</link>
		<comments>http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 01:55:41 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[puppet faces]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/?p=3468</guid>
		<description><![CDATA[TweetPuppet Faces are an extendable API for tricking out your Puppet instances. (&#8220;Faces&#8221; is just short for &#8220;Interfaces&#8221;.) Just a couple days ago I wrote about my survey of puppet + ec2 provisioning tools. The problem I&#8217;m trying to solve, &#8230; <a href="http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton3468" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F11%2F02%2Fpuppet-faces-defaults-and-puppet-node-clean%2F&amp;text=Puppet%20Faces%3A%20defaults%20and%20%26%238216%3Bpuppet%20node%20clean%26%238217%3B&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F11%2F02%2Fpuppet-faces-defaults-and-puppet-node-clean%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Puppet Faces are an extendable API for tricking out your Puppet instances. (&#8220;Faces&#8221; is just short for &#8220;Interfaces&#8221;.) Just a couple days ago I wrote about <a href="http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/">my survey of puppet + ec2 provisioning tools</a>.</p>
<p>The problem I&#8217;m trying to solve, which I don&#8217;t feel like I&#8217;ve solved well, is how to give a type to a new system at bootstrap time, without using DNS. The type variable maps to a node manifest group, and determines the personality of a host &#8211; is it a database, webserver or development instance?</p>
<p>What I&#8217;d like to do is pass a type to puppet at install time and have the puppetmaster and the agent remember that mapping between host and type. </p>
<p>I did it with a really simple Facter plugin, install scripts named by type (passed in to <code>puppet node install</code>), and a file created by the install script in <code>/etc/puppet</code>.</p>
<p>Then, I wanted to be able to see which hosts were configured with which install type. Facter was aware of the type, so this seemed like it should be pretty easy&#8230;</p>
<p>I wrote a quick and dirty Face that pulls information out of <code>$varlib/nodes/*.yaml</code> on the puppet master. I imagine there are better ways to do this, but in the absence of documentation or someone to tell me not to do this, I forged ahead!</p>
<p>There were two things that I spent quite a bit of time chewing on before figuring it out: </p>
<ol>
<li>If you want to make an <code>:action</code> in your Face the default, you just add <code>default</code> in the body of your <code>:action</code> block. I had to dig through a few cloudpack files before I found it!</li>
<li>If you are creating and terminating hosts frequently, you may end up with a bunch of certs and other annoying metadata laying around. To clean it up, the Puppet Node Face has a command you can run:<br />
<code><br />
# puppet node clean [hostname]<br />
</code></p>
<p>You&#8217;ll probably need to be the user that&#8217;s running puppet for this to work &#8212; it affects things that the puppetmaster owns in <code>$varlib</code>. </p>
<p>If you&#8217;re doing this with code, it&#8217;s:<br />
<code><br />
Puppet::Face[:node, :current].clean('hostname')<br />
</code>
</li>
</ol>
<p>I put <a href="https://github.com/selenamarie/puppetlabs-cloud-provisioner/commit/44e7300e1097d8a9290f864154ad591689feadc7">a little patch</a> into a recent version of cloudprovisioner that invokes clean during a terminate. It&#8217;s quick and dirty, and only for AWS. </p>
<p>The resources I&#8217;ve found useful are: </p>
<ul>
<li><a href="http://www.youtube.com/watch?v=C9k9lF4cskg">Kelsey&#8217;s talk at PuppetConf about Faces</a></li>
<li><a href="https://github.com/khightower/puppet-dashboard-face/">Kelsey Hightower&#8217;s Git repo for Puppet Dashboard Face</a></li>
<li><a href="http://www.kartar.net/2011/05/puppet-github-face/">Kartar&#8217;s Github face</a></li>
</ul>
<p>And to a lesser extent, these blog posts were helpful for filling in a few gaps: </p>
<ul>
<li><a href="http://puppetlabs.com/blog/puppet-faces-what-the-heck-are-faces/">What the heck are Faces?</a>
<li><a href="http://puppetlabs.com/blog/about-faces-until-we-go-in-the-right-direction/">Creating a simple &#8220;backup&#8221; Face</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going from Vagrant and Puppet into EC2: A short survey of 5 tools (and two I didn&#8217;t bother trying)</title>
		<link>http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying</link>
		<comments>http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 02:21:58 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[provisioning]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[vagrant]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/?p=3420</guid>
		<description><![CDATA[TweetI thought this would be easy. I started using Vagrant, and was productive with it in about a day. Really a couple hours. Most of my time was spent downloading the correct version of VirtualBox, looking for starter images and &#8230; <a href="http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton3420" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F10%2F28%2Fgoing-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying%2F&amp;text=Going%20from%20Vagrant%20and%20Puppet%20into%20EC2%3A%20A%20short%20survey%20of%205%20tools%20%28and%20two%20I%20didn%26%238217%3Bt%20bother%20trying%29&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F10%2F28%2Fgoing-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I thought this would be easy. </p>
<p>I started using <a href="http://vagrantup.com/docs/getting-started/index.html">Vagrant</a>, and was productive with it in about a day. Really a couple hours. Most of my time was spent downloading the correct version of VirtualBox, <a href="http://morethanseven.net/2011/05/08/Vagrant-plugin-for-interacting-with-vagrantboxes.html">looking for starter images</a> and then a small amount of time experimenting with the Vagrantfile scripting language (<a href="http://vagrantup.com/docs/multivm.html">for multiple VMs</a>).</p>
<p>And we made some Puppet configs.</p>
<p>Then I wanted to use those same Puppet configs with EC2.</p>
<p>So my ultimate goals were: </p>
<ol>
<li>Reuse my existing puppet configs as much as possible</li>
<li>Have a completely automated deploy of a server system (including checkouts of code from a private github repo)</li>
<li>Have a puppetmaster in EC2</li>
<li>Be able to provision systems from EC2 or my laptop</li>
<li>Make the whole process easy for my coworkers</li>
</ol>
<p>This is mostly a list of what I failed at using, and the thing I succeed with at the end.</p>
<p><em>Short aside:</em></p>
<p><b>Pro tip to people writing documentation</b>: Most tutorials and sites that make recommendations for tools leave out the part where you run into all kinds of insane problems. <b>Create a wiki page or a place where you collect the problems.</b> Please. </p>
<p>For example: My Cloud Formation to Ubuntu AMI deploy was failing with an error in cfn.rb that said: &#8220;Unexpected return.&#8221;  Um. Ok. *facepalm*</p>
<p>The problem was that a AWS-image specific JSON file wasn&#8217;t present (and couldn&#8217;t be created) on the target machine. So instead of noting (raise an exception, anyone?) that the file wasn&#8217;t present, the module just executed a bare <code>return</code>. </p>
<p>Because I don&#8217;t know much about Puppet internals, this was a very annoying problem to solve. (like, what gets installed in <code>/var/lib/puppet/lib</code> vs. in the <code>gem install</code> vs. the cloudpack library I was told to install in <code>/etc/puppet/modules</code>?)</p>
<p>Stepping back a bit &#8211; a useful note from the Cloud Formation folks would have been: &#8220;Hey &#8211; this probably won&#8217;t work if you try to deploy to non-Amazon Linux AMI distros of Linux.&#8221; It&#8217;s not obvious that&#8217;s the case! You&#8217;re supposed to be able to completely control the classes being installed on the target system, right? Bad assumption, apparently.</p>
<p><em>And we&#8217;re back!</em></p>
<p>Let me know in the comments if you&#8217;ve successfully navigated any of the tools I didn&#8217;t pick. Juju, in particular, I don&#8217;t think I gave a fair chance (since I didn&#8217;t try it at all). </p>
<p>Here&#8217;s my list: </p>
<ol>
<li><a href="http://www.slideshare.net/derleiermann/juju-puppetconf">Juju</a>
<p>I just wasn&#8217;t sure this was a reasonable thing to install/use. No one I knew had ever heard of it. Didn&#8217;t try it.
</li>
<li><a href="http://www.devco.net/archives/2010/07/14/bootstrapping_puppet_on_ec2_with_mcollective.php">Mcollective + tools ported to PHP</a>
<p>I&#8217;m interested in Mcollective, but the configs looked overly complex, and I didn&#8217;t have anyone close by that was actively using it. </p>
<p>The examples scared me away because of the PHP. I already had three languages at play in the deployment, and I didn&#8217;t need another language dependency. So, I didn&#8217;t bother trying it.
</li>
<li><a href="http://www.codelord.net/2010/12/19/using-puppet-to-automatically-configure-new-ec2-instances/">Custom scripts based on the ec2-tools packages</a>
<p>This approach works, but is fragile and a PITA to keep updated. I tried it as a &#8220;getting oriented&#8221; exercise, and abandoned it.
</li>
<li><a href="https://github.com/jedi4ever/mccloud">Mccloud</a>
<p>This looked awesome! I could reuse all my Vagrant configs and not really have to change anything&#8230; Except I had to maintain duplicate configs, just sub &#8216;Mccloud&#8217;. Eh. </p>
<p>I may revisit this tool in the future, but it seemed to require pretty much the same things as the tool I ultimately decided to use, and didn&#8217;t seem as flexible. I also had a weird restriction where it wouldn&#8217;t allow me to spin up the correct type of image (I wanted m1.small in my testing). Could have been PEBKAC &#8212; I didn&#8217;t take good enough notes to say for sure.
</li>
<li><a href="https://help.ubuntu.com/community/CloudInit">cloud-init</a>
<p>This looked very promising! We were already using Ubuntu so seemed like a good fit. </p>
<p>Pros: easy &#8211; pass in a shell script when starting an EC2 instance from the web. Cons: required yet-another-configuration style. But there were command-line tools and it was looking very promising.</p>
<p>In the end, using a supported package would have required me to be running a Linux desktop to start my puppetmaster. I didn&#8217;t search much harder than <code>brew install cloud-init</code> for a Mac-equivalent (that doesn&#8217;t exist). So, I moved on to the next thing.
</li>
<li><a href="http://aws.amazon.com/cloudformation/">AWS Cloud Formation</a>
<p>I launched a puppetmaster pre-configured instance! I sort of got puppetmaster running! Then I tried to deploy an Ubuntu AMI from it&#8230; This does not work. </p>
<p>So, I will save you a ton of time: <b>Avoid trying to mix the pre-specified Cloud Formation images with other systems.</b></p>
<p>Someone showed me the chunk of the config you can rip out and probably get it to work. I was frustrated at that point, and moved on. Too much tweaking was required, for what was uncertain gain at that point.
</li>
<li><a href="https://github.com/puppetlabs/puppetlabs-cloud-provisioner">PuppetLab&#8217;s Cloud Provisioner</a>
<p>This is what I am currently using! I&#8217;m running <code>HEAD</code> pulled directly from github.  Older versions are not recommended. (I tried three versions.)</p>
<p>The configuration is pretty straightforward and <a href="http://docs.puppetlabs.com/guides/cloud_pack_getting_started.html">documented</a>. The one thing (a very important thing) is that you have to amend your <code>$RUBYLIB</code> if you don&#8217;t install the code in your version of ruby&#8217;s default libdir. There&#8217;s no gem. <a href="http://projects.puppetlabs.com/issues/10379">Yet</a>. </p>
<p>I customized the deploy script to my liking &#8211; there is an unsupported option called <code>--install-script</code> you can pass in that will execute whatever <code>.erb</code> (a shell script!) you&#8217;d like if you put it in <code>~/.puppet/scripts</code>. You can also pass in your puppetmaster hostname with <code>--server</code>.</p>
<p>Totally sweet. </p>
<p>The command-line is ok, but there&#8217;s also a programmatic interface in Ruby. Dan Bode showed me a short code snippet that worked (hostnames &#038; keys sanitized): </p>
<p><code><br />
irb(main):012:0> require 'puppet'<br />
irb(main):013:0> require 'puppet/face'<br />
irb(main):014:0> Puppet::Face[:node, :current].install('myserver.compute-1.amazonaws.com', :keyfile => 'mykey.pem', :login => 'ubuntu', :install_script => 'custom-puppetmaster', :server=>'myserver.compute-1.amazonaws.com')<br />
</code></p>
<p>I so appreciate this! <a href="http://puppetlabs.com/faces/">Faces</a> is awesome. </p>
</li>
</ol>
<p>I&#8217;ve got some additional tweaking to do yet, but I&#8217;m planning to commit a few amendments to the provisioner scripts included by default and the README. And I filed a couple bugs. </p>
<p>Overall, I&#8217;d bet that <a href="https://github.com/puppetlabs/puppetlabs-cloud-provisioner">cloud-provisioner</a> (if you use the version currently on github) will work for most people. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>New user group: Puppet PDX</title>
		<link>http://www.chesnok.com/daily/2009/02/19/new-user-group-puppet-pdx/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-user-group-puppet-pdx</link>
		<comments>http://www.chesnok.com/daily/2009/02/19/new-user-group-puppet-pdx/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 21:59:54 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[user groups]]></category>
		<category><![CDATA[configuration management]]></category>
		<category><![CDATA[or]]></category>
		<category><![CDATA[portland]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[user group]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/?p=730</guid>
		<description><![CDATA[TweetZombie puppet teaser&#8230; Just a quick note that I&#8217;m helping start Puppet PDX and I posted some details over here. Configuration management is awesome stuff, and if you live in the Portland area, you should come check out the new &#8230; <a href="http://www.chesnok.com/daily/2009/02/19/new-user-group-puppet-pdx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton730" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2009%2F02%2F19%2Fnew-user-group-puppet-pdx%2F&amp;text=New%20user%20group%3A%20Puppet%20PDX&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2009%2F02%2F19%2Fnew-user-group-puppet-pdx%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p><center><a href="http://www.flickr.com/photos/ioerror/30671429/in/set-685972"><img src="http://www.chesnok.com/daily/wp-content/uploads/2009/02/flickr-photo-download_-san-francisco-zombie-flash-mob.png" alt="" title="flickr-photo-download_-san-francisco-zombie-flash-mob" width="265" height="254" class="alignnone size-medium wp-image-731" /></a><br/><i><font size="-1">Zombie puppet teaser&#8230;</font></a></i></center></p>
<p>Just a quick note that I&#8217;m helping start Puppet PDX and I posted some details <a href="http://blog.endpoint.com/2009/02/puppet-pdx-will-meet-on-22709.html">over here</a>.  Configuration management is awesome stuff, and if you live in the Portland area, you should come check out the new group.  We&#8217;re meeting at Paddy&#8217;s, 6pm on 2/27/09.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2009/02/19/new-user-group-puppet-pdx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

