<?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/"
	>

<channel>
	<title>Mike Renfro's Blog &#187; puppet</title>
	<atom:link href="http://blogs.cae.tntech.edu/mwr/category/puppet/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.cae.tntech.edu/mwr</link>
	<description>A partial repository of whatever comes to mind</description>
	<lastBuildDate>Sat, 31 Oct 2009 23:02:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stupid Puppet Trick: Identifying Groups of Hosts</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/07/13/stupid-puppet-trick-identifying-groups-of-hosts/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/07/13/stupid-puppet-trick-identifying-groups-of-hosts/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 03:08:21 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/07/13/stupid-puppet-trick-identifying-groups-of-hosts/</guid>
		<description><![CDATA[My Ruby skills are practically non-existant, but I&#8217;ve managed to put together a relatively readable custom fact for identifying my Torque queues by a node&#8217;s hostname. Behold, HostgroupFact! Now I can factor out my hosts.equiv files back to a parent class, rather than duplicating the same file specifications on a per-queue basis.

class cluster-host inherits public-host [...]]]></description>
			<content:encoded><![CDATA[<p>My Ruby skills are practically non-existant, but I&#8217;ve managed to put together a relatively readable custom fact for identifying my Torque queues by a node&#8217;s hostname. Behold, <a href="http://reductivelabs.com/trac/puppet/wiki/Recipes/HostgroupFact">HostgroupFact</a>! Now I can factor out my hosts.equiv files back to a parent class, rather than duplicating the same file specifications on a per-queue basis.</p>
<pre>
class cluster-host inherits public-host {
    # ...
    file { "/etc/hosts.equiv":
        source  =&gt; "puppet:///files/apps/rsh-server/hosts.equiv.$hostgroup",
        owner   =&gt; root,
        group   =&gt; root,
        mode    =&gt; 644,
        require =&gt; Package[rsh-server],
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/07/13/stupid-puppet-trick-identifying-groups-of-hosts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stupid Puppet Trick: Poor Man&#8217;s Undo</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/07/12/stupid-puppet-trick-poor-mans-undo/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/07/12/stupid-puppet-trick-poor-mans-undo/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 01:16:07 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/07/12/stupid-puppet-trick-poor-mans-undo/</guid>
		<description><![CDATA[If I apply a set of classes to a puppet client, I may need to roll back those classes&#8217; changes later. Granted, I could just edit out those classes, reformat the system, and rebuild it from scratch, but there may be times when I want to undo my changes in a more granular fashion. So [...]]]></description>
			<content:encoded><![CDATA[<p>If I apply a set of classes to a puppet client, I may need to roll back those classes&#8217; changes later. Granted, I could just edit out those classes, reformat the system, and rebuild it from scratch, but there may be times when I want to undo my changes in a more granular fashion. So here&#8217;s my latest revelation (which is undoubtedly documented elsewhere already, but I didn&#8217;t find anything sufficiently simple last time I looked).</p>
<p>Along the lines of <a href="http://reductivelabs.com/trac/puppet/wiki/PuppetBestPractice">Puppet Best Practice 2.0</a>, I&#8217;m trying to compartmentalize all my building blocks into separate modules, even the really simple ones that just install a package or two. So here&#8217;s the contents of a trivial hello module for Debian:</p>
<pre>
# /etc/puppet/modules/hello/manifests/init.pp
class hello {
  package { "hello":
    ensure =&gt; latest;
  }
}
</pre>
<p>Nothing complicated here: install this package via the default package provider. Add an <code>include hello</code> to my node&#8217;s manifest, and the hello package gets installed.</p>
<p>Now for the &#8220;undo&#8221; class:</p>
<pre>
# /etc/puppet/modules/hello/manifests/disabled.pp
class hello::disabled inherits hello {
  Package["hello"] {
    ensure =&gt; purged
  }
}
</pre>
<p>And this is neat. Properly written, the disabling class can undo all the changes made by the parent class. Modify my node&#8217;s manifest from <code>include hello</code> to <code>include hello::disabled</code> and I can switch that class on and off like, well, a switch.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/07/12/stupid-puppet-trick-poor-mans-undo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I Killed the Mail Server Today</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 03:00:57 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Stupid!]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today-2/</guid>
		<description><![CDATA[
It all started so simply: I was going to set up a little Xen instance to be my next cluster submit host, and needed a spare address for it:

I started setting up an instance for ch208i.cae.tntech.edu, since it was no longer on the Xen host like it was several months ago. Crap, the reason it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div><a href="http://icanhascheezburger.com/2008/07/07/funny-pictures-i-have-the-dumb/"><img class="mine_1410833" src="http://icanhascheezburger.wordpress.com/files/2008/07/funny-pictures-cat-cannot-brain-today.jpg" alt="cat" /></a></div>
<p>It all started so simply: I was going to set up a little Xen instance to be my next cluster submit host, and needed a spare address for it:</p>
<ol>
<li>I started setting up an instance for ch208i.cae.tntech.edu, since it was no longer on the Xen host like it was several months ago. Crap, the reason it&#8217;s no longer on the Xen instance is because I moved it to its own dedicated hardware &#8212; it&#8217;s still my main ftp/mirror server. Ctrl-C that one.</li>
<li>Hmm, what&#8217;s available from old Xen instances? mail2.cae.tntech.edu.cfg from when I was testing out a new mail server setup last fall &#8212; doesn&#8217;t ping, doesn&#8217;t show up in <code>xm list</code>, no problem.
<pre>xen-create-image --hostname=mail2.cae.tntech.edu --ip=149.149.254.23 \
    --gateway=149.149.254.4 --netmask=255.255.255.0 --size=10Gb --memory=256Mb \
    --swap=1Gb --debootstrap --force</pre>
<p>A few minutes later, my instance is debootstrapped and ready to go.</li>
<li>Oh, crap. Why am I getting an error on <code>xm create</code> that says my LVM is already in use on a domU somewhere?</li>
<li>Further crap. Looking in <code>/etc/xen/mail.cae.tntech.edu.cfg</code> for the production mail server, it apparently uses the old mail2.cae.tntech.edu LVMs. Wonderful. <code>ssh mail</code>? It works since sshd was already memory-resident, but <code>/root/.profile</code> doesn&#8217;t exist. And neither does much of anything else.</li>
<li>Great. I&#8217;ve just killed the mail server. Off to the Amanda server to do a quick restore of its data. What? I never put mail.cae.tntech.edu into the backup list? Not normally the end of the world, since the mail stores are held accessed over NFS from the main file server, but what about my dovecot and postfix configurations?</li>
<li>Oh, well. Time to see how good my puppet manifests are for the mail server.</li>
</ol>
<p>Not too bad, as it turns out. Total downtime was only a couple hours, including having to redo the postfix and dovecot configurations (which were then copied off to the puppetmaster). I still have a few more things to fix, but mail delivery is up, and imap is running. TLS support for my sending mail from home isn&#8217;t up yet, but it&#8217;ll be fixed shortly.</p>
<p>I still need to fix that submit host, though. Next time, I think I&#8217;ll use an IP address reserved for my office.</p>
<p><strong>Update:</strong> after getting a partial TLS/SASL setup going late Wednesday night, I went to sleep without realizing I&#8217;d killed mail delivery again. Finally got it straightened out Thursday morning.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/07/09/i-killed-the-mail-server-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Giving a Presentation at the Tennessee Higher Education IT Symposium</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/04/22/giving-a-presentation-at-the-tennessee-higher-education-it-symposium/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/04/22/giving-a-presentation-at-the-tennessee-higher-education-it-symposium/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 11:57:15 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/04/22/giving-a-presentation-at-the-tennessee-higher-education-it-symposium/</guid>
		<description><![CDATA[I&#8217;m heading to the IT Symposium this morning to give a talk on creating a managed Unix infrastructure from scratch, somewhat of a summary of several things I&#8217;ve posted here over the last year or so. Thanks to the folks on #puppet who read over them and gave editing suggestions.

Slides for presentation
Handouts for presentation

Update: So [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m heading to the <a href="http://www.tntech.edu/itsymposium/">IT Symposium</a> this morning to give a talk on creating a managed Unix infrastructure from scratch, somewhat of a summary of several things I&#8217;ve posted here over the last year or so. Thanks to the folks on #puppet who read over them and gave editing suggestions.</p>
<ul>
<li><a href='http://blogs.cae.tntech.edu/mwr/files/2008/04/unix_infrastructure_management_from_scratch_slides.pdf' title='Slides for presentation'>Slides for presentation</a></li>
<li><a href='http://blogs.cae.tntech.edu/mwr/files/2008/04/unix_infrastructure_management_from_scratch_handouts.pdf' title='Handouts for presentation'>Handouts for presentation</a></li>
</ul>
<p><strong>Update:</strong> So yesterday, I get an email regarding my presentation (well, the slides, at least). No reason to clutter up the main page with it though, so if you&#8217;re not happy with the slides and want to express your displeasure, read the rest after the jump and see if I&#8217;ve addressed your concerns already.<span id="more-62"></span></p>
<blockquote><p>
Hi Mike,</p>
<p>I&#8217;ve visited your site before and found your Debian preseeding info to be useful.</p>
<p>That said, I just went through your presentation slides and must say I&#8217;m very disappointed.  It contains numerous examples of what gives sysadmins a bad name.  Egotistical, &#8220;I&#8217;m right, you&#8217;re stupid&#8221;, &#8220;I did this because I&#8217;m way too busy doing more important things than you&#8221;, etc. comments abound.</p>
<p>On several occasions your first bullet-point was &#8220;just do it&#8221;, or &#8220;you need this&#8221;.  Hey Mike, people don&#8217;t come to conferences and presentations to listen to a smart-ass.</p>
<p>You mentioned that the people in #puppet gave you useful feedback.  Next time you give a presentation, also get feedback from non-geeks.  They&#8217;ll help you filter out the cruft that makes you look like a spoiled 5-year old talking about his new widget set at show-and-tell.</p>
<p>I hope for the sake of the attendees that your verbal presentation was better than your slideshow.
</p></blockquote>
<p>To respond to the comments more or less in order:</p>
<ul>
<li>Sorry you didn&#8217;t like my slides. At first, I thought you were an irritated audience member who waited a couple of weeks before emailing me. But since you&#8217;re apparently only judging this based off the slides, that&#8217;s different.</li>
<li>&#8220;I&#8217;m right, you&#8217;re stupid&#8221; is in the eye of the reader. Though you can&#8217;t tell without the soundtrack, it tended to work out more like &#8220;I used to do things one way, which probably is the most common way everyone else does it. It didn&#8217;t scale for the following reasons, and here&#8217;s what I&#8217;m doing instead.&#8221;</li>
<li>&#8220;I did it this way because I&#8217;m way too busy doing more important things than you&#8221; is a bit of an exaggerated inference. Am I busy? Sure. Am I busy doing things that most sysadmins don&#8217;t have to deal with? As far as I can tell, yes; most of the sysadmins in my immediate vicinity (and from past experience over the last 15-20 years) don&#8217;t have major duties outside systems administration, just like most of the engineers don&#8217;t have major duties outside their specialty or lab. These non-sysadmin tasks aren&#8217;t necessarily more important <em>per se</em>, but they&#8217;re important in my particular job description. The hours these other tasks take up in my week force me to find more efficient methods to do the systems administration tasks; others will possibly hit the same walls I have at different times &#8212; maybe when they have to keep track of 300 servers in 10 different roles, where all servers in a particular role have to be interchangeable. Maybe when they get a 1000 node cluster where a particular application has to be installed identically on every node, and on every node to be purchased in the future. My belief is that as time goes on, we&#8217;re all going to be managing more systems, not fewer, and that methods we use for managing a few systems relatively well don&#8217;t scale to larger groups of computers.</li>
<li>&#8220;Just do it&#8221; or &#8220;You need this&#8221; shows up in three places: using version control, using NTP for time synchronization, and using SMTP for email. I stand by each of those points, being entirely convinced by the verbiage at <a href="http://infrastructures.org/">infrastructures.org</a> that was my primary source material. I cannot fathom why someone would use something other than SMTP for sending email, why they wouldn&#8217;t want version control of some form as the code that automates their systems administration tasks grows more complicated, or why they&#8217;d use a different protocol to synchronize their system clocks. To me, each of those is as self-evident as &#8220;your SAN should have redundant power supplies&#8221; and &#8220;racks are a good way to house a bunch of servers in a small space&#8221;. You may have counterexamples, but since you didn&#8217;t provide any, I&#8217;m left in the dark.</li>
<li>The folks on #puppet did give me some useful feedback. As for other feedback, I did ask a coworker to look at the slides, and he saw no problems with them. However, he&#8217;s a full-time Windows systems administrator, so his opinion may be suspect. As for non-geeks, they&#8217;re really not the intended audience, were generally absent from the conference, and aren&#8217;t too likely to be interested in systems administration techniques.</li>
<li>Cruft in the verbal presentation? Guilty, but some might call it illustrative anecdotes. Personally, I&#8217;ve always tried to work in <a href="http://www.sciencecartoonsplus.com/">Sidney Harris</a>&#8216; &#8220;I think you should be more explicit here in step two&#8221; joke into at least one over-equationed lecture per semester. The students seem to enjoy it:<br />
<img src='http://blogs.cae.tntech.edu/mwr/files/2008/05/math07.gif' alt='I think you should be more explicit here in step two' /><br />
Cruft in the slides? Matter of opinion, I guess. I did run out of time, but I honestly hadn&#8217;t done enough practice runs to see how long it would actually take.</li>
<li>As for the spoiled five-year-old showing off his new widget set at show-and-tell, I have trouble understanding the issue. Lots of the talks at these conferences are basically a show-and-tell: other talks included &#8220;Software Deployment Using Ghost&#8221;, &#8220;Virtualizing Business Continuity &#8212; Getting Your Systems Back Online,&#8221; &#8220;DBA Task Automation II: Extending the Basics, Best Practices, Processes and Icing,&#8221; etc. When I submit an abstract saying that I&#8217;m going to give a talk about what goes into a &#8220;managed infrastructure,&#8221; its benefits over regular administration methods, and talk about a particular tool we use to accomplish some of these tasks, exactly what do I change in material? What do I change in delivery (that you didn&#8217;t see)? You&#8217;ve never told coworkers &#8220;holy crap, this Linux thing is awesome! It&#8217;s like Unix, but free and runs on regular PCs!&#8221; or similar? Nothing about using PHP to format stuff out of a database for some dynamic web pages? Nothing about a CMS or blogging platform that lets you do all the things a CMS or blog is supposed to do? Nothing about rrdtool, Nagios, cacti, apt-get, Perl/Python/Ruby or some other tool that you didn&#8217;t write, but by gosh it&#8217;s going to make all of your lives easier?</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/04/22/giving-a-presentation-at-the-tennessee-higher-education-it-symposium/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Stupid Puppet Trick: Agreeing to the Sun Java License with Debconf Preseeds and Puppet</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/02/05/stupid-puppet-trick-agreeing-to-the-sun-java-license-with-debconf-preseeds-and-puppet/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/02/05/stupid-puppet-trick-agreeing-to-the-sun-java-license-with-debconf-preseeds-and-puppet/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 17:26:30 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/02/05/stupid-puppet-trick-agreeing-to-the-sun-java-license-with-debconf-preseeds-and-puppet/</guid>
		<description><![CDATA[I had a user ask for Java to be installed on the cluster systems, so I started up by making a simple JRE5 module for puppet, but this first one didn&#8217;t quite work:

class jre5 {
  package { "sun-java5-jre":
    ensure =&#62; latest;
  }
}

It doesn&#8217;t work because Sun wants you to agree [...]]]></description>
			<content:encoded><![CDATA[<p>I had a user ask for Java to be installed on the cluster systems, so I started up by making a simple JRE5 module for puppet, but this first one didn&#8217;t quite work:</p>
<pre>
class jre5 {
  package { "sun-java5-jre":
    ensure =&gt; latest;
  }
}
</pre>
<p>It doesn&#8217;t work because Sun wants you to agree to its license before installing the JRE. There&#8217;s a couple of ways around this. First, the old-school method:</p>
<pre>
ssh host "yes | apt-get -y install sun-java5-jre"
</pre>
<p>where &#8216;yes&#8217; is a standard Unix program that just prints out &#8220;yes&#8221; over and over until the program on the other side of the pipe terminates. But &#8220;ssh host foo&#8221; is not the way of the managed infrastructure. </p>
<p>The second method, much more friendly to centralized management, is to first install debconf-utils on a candidate system, and then install sun-java5-jre on the same system. Once that&#8217;s done, you can query the debconf database to see how it stored your answers to the Sun license agreement:</p>
<pre>
ch226-12:~# debconf-get-selections | grep sun-
sun-java5-bin   shared/accepted-sun-dlj-v1-1    boolean true
sun-java5-jre   shared/accepted-sun-dlj-v1-1    boolean true
sun-java5-jre   sun-java5-jre/jcepolicy note
sun-java5-jre   sun-java5-jre/stopthread        boolean true
sun-java5-bin   shared/error-sun-dlj-v1-1       error
sun-java5-jre   shared/error-sun-dlj-v1-1       error
sun-java5-bin   shared/present-sun-dlj-v1-1     note
sun-java5-jre   shared/present-sun-dlj-v1-1     note
</pre>
<p>Save those results (debconf seeds) into a file on the gold server. Then we can modify our jre5 class as follows:</p>
<pre>
class jre5 {
  package { "sun-java5-jre":
    require      =&gt; File["/var/cache/debconf/jre5.seeds"],
    responsefile =&gt; "/var/cache/debconf/jre5.seeds",
    ensure       =&gt; latest;
  }

  file { "/var/cache/debconf/jre5.seeds":
    source =&gt; "puppet:///jre5/jre5.seeds",
    ensure =&gt; present;
  }
}
</pre>
<p>Now our class will download the preseeded answers for the Java license, download and install the JRE, and then use the preseeded answers to skip past the license agreement. I had never messed with debconf seeding previously, since I had either just imaged my systems, or provided config files that would be used when I restarted any daemons or programs that depended on those files. Now debconf-utils is part of my standard system class definition.</p>
<p>Note that this method doesn&#8217;t work with the default puppet provided in Debian Etch (version 0.20) &#8212; the responsefile parameter for Debian packages was only added in puppet 0.22.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/02/05/stupid-puppet-trick-agreeing-to-the-sun-java-license-with-debconf-preseeds-and-puppet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Obscure Puppet Error #1</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/02/01/obscure-puppet-error-1/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/02/01/obscure-puppet-error-1/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 03:08:26 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/02/01/obscure-puppet-error-1/</guid>
		<description><![CDATA[(First in a series of some finite positive number, for the greater edification of Googlers everywhere.)
If you get an error of err: Could not retrieve catalog: Could not parse for environment development: Syntax error at 'Debian' at /etc/puppet/master/manifests/os/Debian.pp:1 on a Debian.pp that only has one line of class Debian {}, just go ahead and change [...]]]></description>
			<content:encoded><![CDATA[<p>(First in a series of some finite positive number, for the greater edification of Googlers everywhere.)</p>
<p>If you get an error of <code>err: Could not retrieve catalog: Could not parse for environment development: Syntax error at 'Debian' at /etc/puppet/master/manifests/os/Debian.pp:1</code> on a Debian.pp that only has one line of <code>class Debian {}</code>, just go ahead and change it to <code>class debian {}</code>, then go on with your life. Yes, I know you tried to be smart and use the output of <code>facter operatingsystem</code> and to make <code>include $operatingsystem</code> work right, but just lowercase the class name.</p>
<p>Carry on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/02/01/obscure-puppet-error-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The autostow is Dead, Long Live stowedpackage!</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/02/01/the-autostow-is-dead-long-live-stowedpackage/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/02/01/the-autostow-is-dead-long-live-stowedpackage/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 21:15:52 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2008/02/01/the-autostow-is-dead-long-live-stowedpackage/</guid>
		<description><![CDATA[I had posted earlier about distributing stowed packages via rsync and puppet to my managed systems, but that method wasn&#8217;t quite what I wanted:

There was one more file to manage outside my regular puppet manifests, and I&#8217;d have to remember to keep them both up to date and in sync.
There wasn&#8217;t an easy way of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.cae.tntech.edu/mwr/2007/05/19/client-application-management-part-2-for-stow-packages/">I had posted earlier</a> about distributing stowed packages via rsync and puppet to my managed systems, but that method wasn&#8217;t quite what I wanted:</p>
<ol>
<li>There was one more file to manage outside my regular puppet manifests, and I&#8217;d have to remember to keep them both up to date and in sync.</li>
<li>There wasn&#8217;t an easy way of ensuring that other versions of a particular package got unstowed before deploying out the desired version.</li>
<li>The entire stow tree would be copied out to every system, regardless of whether OpenMPI was a good fit for the web server.</li>
</ol>
<p>So, here&#8217;s my new method:</p>
<ol>
<li>Keep my same metastow module loaded on the rsync server. The metastow module contains one top-level directory per puppet architecture (i686, x86_64, etc.). Each of those architecture folders is a stow tree containing every stowed package for that architecture.</li>
<li>Add a stowedpackage definition to my puppet manifests as follows:
<pre>
define stowedpackage ( $basepackage, $version,
    $rsyncserver='gold.cae.tntech.edu',
    $rsyncmodule='metastow',
    $stowdestdir='/usr/local/stow' ) {
    file { "stow-initiator_${basepackage}-${version}":
        source =&gt; "puppet:///files/stow-initiator_${basepackage}-${version}",
        path   =&gt; "/etc/puppet/stow-initiator_${basepackage}-${version}",
    }
    exec { download:
        command     =&gt; "/usr/bin/rsync -a --delete ${rsyncserver}::${rsyncmodule}/${hardwaremodel}/${basepackage}-${version} ${stowdestdir}",
        refreshonly =&gt; true,
        subscribe   =&gt; File["stow-initiator_${basepackage}-${version}"],
        alias       =&gt; "download_${basepackage}-${version}"
    }
    exec { unstow-others:
        command     =&gt; "cd ${stowdestdir} &amp;&amp; stow --delete ${basepackage}-*",
        refreshonly =&gt; true,
        subscribe   =&gt; Exec["download_${basepackage}-${version}"],
        alias       =&gt; "unstow-others_${basepackage}-${version}"
    }
    exec { stow:
        command     =&gt; "cd ${stowdestdir} ; stow ${basepackage}-${version}",
        refreshonly =&gt; true,
        subscribe   =&gt; Exec["unstow-others_${basepackage}-${version}"]
    }
}
</pre>
</li>
<li>Use the stowedpackage definition in other parts of my manifests:
<pre>
# Create OpenMPI installation and configuration.
class openmpi {

    stowedpackage {
        "openmpi-1.0.1":
            basepackage=&gt;"openmpi",
            version=&gt;"1.0.1";
    }

}
</pre>
</li>
<li>Add a trigger file to the puppetmaster&#8217;s /etc/puppet/files folder:
<pre>
/etc/puppet/files# date &gt; stow-initiator_openmpi-1.0.1
</pre>
</li>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/02/01/the-autostow-is-dead-long-live-stowedpackage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Client Configuration Management</title>
		<link>http://blogs.cae.tntech.edu/mwr/2007/10/31/client-configuration-management/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2007/10/31/client-configuration-management/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 01:17:21 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2007/10/31/client-configuration-management/</guid>
		<description><![CDATA[Back at the infrastructures.org mothership, client configuration management is described as everything that makes a host unique and/or part of a particular group or domain. And for Unix-like systems, everything pretty much comes down to configuration files, services being enabled/disabled, and cron jobs.
Hmm.

Configuration files
Services
Cron jobs

Looks like Puppet pretty much handles all of that. As long [...]]]></description>
			<content:encoded><![CDATA[<p>Back at the infrastructures.org mothership, <a href="http://www.infrastructures.org/bootstrap/config.shtml">client configuration management</a> is described as everything that makes a host unique and/or part of a particular group or domain. And for Unix-like systems, everything pretty much comes down to configuration files, services being enabled/disabled, and cron jobs.</p>
<p>Hmm.</p>
<ul>
<li><a href="http://reductivelabs.com/trac/puppet/wiki/TypeReference#file">Configuration files</a></li>
<li><a href="http://reductivelabs.com/trac/puppet/wiki/TypeReference#service">Services</a></li>
<li><a href="http://reductivelabs.com/trac/puppet/wiki/TypeReference#cron">Cron jobs</a></li>
</ul>
<p>Looks like Puppet pretty much handles all of that. As long as I can describe aspects of my systems with puppet classes and modules, I&#8217;ve got reusable, consistent configurations on any servers I care to manage.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2007/10/31/client-configuration-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client File Access</title>
		<link>http://blogs.cae.tntech.edu/mwr/2007/10/31/client-file-access/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2007/10/31/client-file-access/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 01:00:16 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2007/10/31/client-file-access/</guid>
		<description><![CDATA[The infrastructures.org folks list two primary goals of what they call &#8220;client file access&#8220;: first, consistent access to users&#8217; home directories, and second, consistent access to end-user applications. Some of the things they warn against, such as automounters and the /net directory, we never thought of using to begin with. Their need to consider systems [...]]]></description>
			<content:encoded><![CDATA[<p>The infrastructures.org folks list two primary goals of what they call &#8220;<a href="http://www.infrastructures.org/bootstrap/fileclient.shtml">client file access</a>&#8220;: first, consistent access to users&#8217; home directories, and second, consistent access to end-user applications. Some of the things they warn against, such as automounters and the /net directory, we never thought of using to begin with. Their need to consider systems with limited disk space and a need to mount a software share via NFS is less of an issue with us, too: disks large enough to hold our regular software load are relatively cheap, so there shouldn&#8217;t be much of a problem there. And since we&#8217;re supposed to be deploying applications consistently via Puppet, there shouldn&#8217;t be any inconsistency in where an application is installed. As far as consistent access to the home directories, we accomplish this with a two-pronged solution in Puppet &#8212; one on the file server, and one on the clients:<br />
<span id="more-48"></span><br />
On the Debian file server, we include the following class:</p>
<pre>
class nfs-server {
  package { nfs-kernel-server: ensure =&gt; installed }

  file { exports:
    path =&gt; $operatingsystem ? {
      default =&gt; "/etc/exports"
    },
    owner =&gt; root, group =&gt; root, mode =&gt; 644,
    source =&gt; "puppet://gold.cae.tntech.edu/files/apps/nfs-server/exports",
    require =&gt; Package[nfs-kernel-server]
  }

  service { nfs-kernel-server:
    ensure =&gt; running,
    enable =&gt; true,
    hasstatus =&gt; true,
    subscribe =&gt; [Package[nfs-kernel-server], File[exports]]
  }
  service { portmap:
    ensure =&gt; running,
    enable =&gt; true,
  }
}
</pre>
<p>We also include the following in its node definition:</p>
<pre>
    file {
        "/etc/exports.d":
        source  =&gt; "puppet:///files/apps/nfs-kernel-server/exports.d",
        ensure  =&gt; directory,
        ignore  =&gt; ".svn",
        purge   =&gt; true,
        recurse =&gt; inf;
    }

    concatenated_file {
        "/etc/exports":
            dir =&gt; "/etc/exports.d";
    }
</pre>
<p>Each file dropped in /etc/exports.d is a fragment of /etc/exports. Right now, we&#8217;re using one fragment per exported filesystem. As an example, here&#8217;s /etc/exports.d/_opt_solaris_stow:</p>
<pre>
/opt/solaris/stow \\
        149.149.254.12(rw,sync,no_root_squash) \\
        149.149.254.13(rw,sync,no_root_squash) \\
        149.149.254.14(rw,sync,no_root_squash) \\
        149.149.254.15(rw,sync,no_root_squash) \\
        149.149.254.220(rw,sync,no_root_squash)
</pre>
<p>David Schmitt&#8217;s concatenated_file definition combines all the export fragments into one /etc/exports file:</p>
<pre>
define concatenated_file ($dir, $mode = 0644, $owner = root, $group = root)
{
    file {
        $name:
            ensure   =&gt; present,
            checksum =&gt; md5,
            mode     =&gt; $mode,
            owner    =&gt; $owner,
            group =&gt; $group;
    }
    exec { "find ${dir} -maxdepth 1 -type f ! -name '*puppettmp' -print0 | sort -z | xargs -0 cat &gt; ${name}":
        refreshonly =&gt; true,
        subscribe   =&gt; File[$dir],
        alias       =&gt; "concat_${name}",
    }
}
define concatenated_file_part ($dir, $content = '', $ensure = present,
                               $mode = 0644, $owner = root, $group = root) {
    file { "${dir}/${name}":
        ensure  =&gt; $ensure,
        content =&gt; $content,
        mode    =&gt; $mode,
        owner   =&gt; $owner,
        group   =&gt; $group,
        alias   =&gt; "cf_part_${name}",
    }
}
</pre>
<p>On the client side, we just make sure we can mount the NFS share. For example:</p>
<pre>
    file {
        "/home/CAE":
            ensure =&gt; directory,
            owner  =&gt; root,
            group  =&gt; root,
            mode   =&gt; 755,
    }
    mount { "/home/CAE":
        require =&gt; File["/home/CAE"],
        atboot  =&gt; true,
        fstype  =&gt; "nfs",
        device  =&gt; "files.cae.tntech.edu:/home/CAE",
        ensure  =&gt; mounted,
        options =&gt; "defaults",
        dump    =&gt; "0",
        pass    =&gt; "0",
    }
    package { "nfs-common": ensure =&gt; installed }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2007/10/31/client-file-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File Replication Servers</title>
		<link>http://blogs.cae.tntech.edu/mwr/2007/10/31/file-replication-servers/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2007/10/31/file-replication-servers/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 00:30:51 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2007/10/31/file-replication-servers/</guid>
		<description><![CDATA[Back when the infrastructures.org folks were writing their pages, the page for file replication servers described a need to keep current copies of configuration files in /etc and all programs and other data from /usr/local on all the managed systems. In puppet structures, every file or other resource is just a part of a higher-order [...]]]></description>
			<content:encoded><![CDATA[<p>Back when the infrastructures.org folks were writing their pages, <a href="http://www.infrastructures.org/bootstrap/replication.shtml">the page for file replication servers</a> described a need to keep current copies of configuration files in /etc and all programs and other data from /usr/local on all the managed systems. In puppet structures, every file or other resource is just a part of a higher-order class or module. If we&#8217;re already keeping our classes and modules up to date on all the managed systems, then old-school file replication goes along automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2007/10/31/file-replication-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
