<?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; cfengine</title>
	<atom:link href="http://blogs.cae.tntech.edu/mwr/category/cfengine/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>Client Application Management (Part 2, for stow packages)</title>
		<link>http://blogs.cae.tntech.edu/mwr/2007/05/19/client-application-management-part-2-for-stow-packages/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2007/05/19/client-application-management-part-2-for-stow-packages/#comments</comments>
		<pubDate>Sat, 19 May 2007 19:30:10 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[cfengine]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2007/05/19/client-application-management-part-2-for-stow-packages/</guid>
		<description><![CDATA[UPDATE: this page largely superceded by the stowedpackage puppet definition.
Back in part 1, I outlined how I&#8217;m getting a consistent package load on my various hosts with pkgsync and puppet. This works great for things that are already included in Debian. And I&#8217;ll make .deb packages of some of our third-party commercial applications, too (Matlab, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> this page largely superceded by <a href="http://blogs.cae.tntech.edu/mwr/2008/02/01/the-autostow-is-dead-long-live-stowedpackage/">the stowedpackage puppet definition</a>.</p>
<p>Back in <a href="http://blogs.cae.tntech.edu/mwr/2007/05/14/client-application-management/">part 1</a>, I outlined how I&#8217;m getting a consistent package load on my various hosts with pkgsync and puppet. This works great for things that are already included in Debian. And I&#8217;ll make .deb packages of some of our third-party commercial applications, too (Matlab, Abaqus, Ansys, etc.), mostly for the ease of running &#8216;apt-get install matlab74&#8242; or making one entry into a pkgsync definition. But some things are more of a pain to package up, and it&#8217;s easier to let them install into /usr/local. But since I don&#8217;t want /usr/local to become an unmanageable mess, I&#8217;ve been using <a href="http://www.gnu.org/software/stow/">GNU Stow</a> to manage it. The basics of stow is that a package (for example, <a href="http://www.clusterresources.com/pages/products/torque-resource-manager.php">Torque</a>) that wants to install into /usr/local instead gets installed into /usr/local/stow/torque-2.1.6, and stow symlinks from /usr/local/sbin/pbs_mom to /usr/local/stow/torque-2.1.6/sbin/pbs_mom, and for all other files and directories contained in all your stowed packages.</p>
<p>So I needed a way to ensure that a particular set of packages was deployed consistently to a set of machines, and minor modifications to <a href="http://www.debian-administration.org/articles/398">autoapt</a> seemed to be the easiest and most robust way to go at the time. Details after the jump.<span id="more-22"></span></p>
<p>External files needed:</p>
<ul>
<li><a href="http://www.cae.tntech.edu/~mwr/private/autostow.pl">autostow.pl</a></li>
<li><a href="http://www.cae.tntech.edu/~mwr/private/autostow.cfg">autostow.cfg</a></li>
</ul>
<p>My changes to autoapt aren&#8217;t rocket science: basically I just removed the logic for version checking (since my naming convention for stowing packages automatically includes their version number) , changed the external commands from apt-get to stow, and added support for prerm and postinst scripts for each stowed package. Also, to trigger a restowing via puppet, rather than by cron job or manually, I&#8217;m adapting <a href="http://www.reductivelabs.com/trac/puppet/wiki/DebianRecipies">the method for triggering apt-get dist-upgrades via puppet</a>.</p>
<p>Puppetmaster configuration: install rsync as a daemon. Though if you want to use a different server for rsync, that&#8217;s fine, too. My stow tree isn&#8217;t too large, and I&#8217;d just as soon have it managed off the same system that runs puppetmaster. My /etc/rsyncd.conf contains:</p>
<pre>[metastow]
path = /usr/local/metastow
hosts allow = 149.149.254.0/24
hosts deny = *
read only
uid = 0</pre>
<p>The read only is a safety precaution, and uid = 0 is required so that I can retrieve items that are on root-only permission (Torque&#8217;s pbs_mom, for example).  The metastow directory itself contains folders for each managed hardware architecture (currently i686 and x86_64), and each of the architecture folders holds the stowed directories, plus prerm and postinst scripts if applicable:</p>
<pre>
gold:/usr/local/metastow/x86_64# ls -ald torque-2.1.6*
drwxr-sr-x 7 root staff 4096 Apr 13 09:14 torque-2.1.6
-rwxr-xr-x 1 root staff   34 Apr 30 11:13 torque-2.1.6.postinst
-rwxr-xr-x 1 root staff   36 Apr 30 11:12 torque-2.1.6.prerm</pre>
<p>Puppet configuration: I have a class of parallel computing systems that need Torque and <a href="http://ganglia.info/">Ganglia</a> installed. In their class definition:</p>
<pre>
class cluster-host inherits cae-host {
  file { "/etc/stow_initiator":
    source =&gt; "puppet://gold.cae.tntech.edu/files/stow_initiator",
  }
  file { "/etc/puppet/autostow.pl":
    source =&gt; "puppet://gold.cae.tntech.edu/files/autostow.pl"
  }
  file { "/etc/puppet/autostow.cfg":
    source =&gt; "puppet://gold.cae.tntech.edu/files/autostow.cfg"
  }
  exec { "rsync -avz --delete gold.cae.tntech.edu::metastow/$hardwaremodel/ /usr/local/stow/ ; /etc/puppet/autostow.pl --filename=/etc/puppet/autostow.cfg --classes=cluster_host":
    refreshonly =&gt; true,
    subscribe =&gt; File["/etc/stow_initiator"],
  }
}</pre>
<p>The $hardwaremodel variable is automatically defined by Facter if you have the lsb-release Debian package installed. The top-level cae-host class automatically installs it via pkgsync, but just to be safe, I&#8217;ll probably add it to my minimal list of preseeded packages for system installation. That way, I know my definitions will all work right out of the box.</p>
<p>Test out your stow packages before deploying them into the metastow tree. In particular, make sure they don&#8217;t conflict with anything already in /usr/local &#8212; at the time I built my i686 torque packages under Sarge, /usr/local/man was an acceptable folder. Etch symlinked /usr/local/man to /usr/local/share/man, and as a result, my torque package wouldn&#8217;t deploy under Etch.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2007/05/19/client-application-management-part-2-for-stow-packages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Gold Server</title>
		<link>http://blogs.cae.tntech.edu/mwr/2007/05/06/the-gold-server/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2007/05/06/the-gold-server/#comments</comments>
		<pubDate>Sun, 06 May 2007 18:25:27 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[cfengine]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2007/05/06/the-gold-server/</guid>
		<description><![CDATA[In infrastructures.org terminology, the gold server is the one location that all clients check in with to see if they need to make any configuration changes. No changes needed? No changes made. No gold server available right now? No changes made, check back later. In theory, this should be a pretty simple server to provision. [...]]]></description>
			<content:encoded><![CDATA[<p>In infrastructures.org terminology, the <a href="http://www.infrastructures.org/bootstrap/gold.shtml">gold server</a> is the one location that all clients check in with to see if they need to make any configuration changes. No changes needed? No changes made. No gold server available right now? No changes made, check back later. In theory, this should be a pretty simple server to provision. Do a base OS installation, then enable the configuration management daemons, and let everything else grow from there.</p>
<p>Our gold server is a Xen instance with 128 MB memory and 10 GB disk running Debian 4.0. Top-level packages installed include puppet, puppetmaster, cfengine2, subversion, and xemacs21. The subversion repository for the gold server has /etc/cfengine and /etc/puppet as its top-level folders:</p>
<p><a href="http://blogs.cae.tntech.edu/mwr/files/2007/05/repository-top.jpg" title="repository-top.jpg"><img src="http://blogs.cae.tntech.edu/mwr/files/2007/05/repository-top.jpg" alt="repository-top.jpg" /></a></p>
<p><a href="http://www.reductivelabs.com/trac/puppet/wiki/SimplestPuppetInstallRecipe">Puppet&#8217;s getting started docs</a> work pretty well here. One thing to keep in mind with the Debian and Ubuntu puppet packages is that they have the <code>--waitforcert</code> value set to 0, so they&#8217;ll immediately exit after sending their key to the gold server. <strike>Once you sign their key on the gold server, puppet will work fine after a <code>/etc/init.d/puppet</code> start, but this gets in the way of unattended installation. I&#8217;ll probably end up putting <code>waitforcert</code> back to its default of 120 seconds when I get back to the bootstrapping procedure.</strike> I&#8217;ve made a /etc/default/puppet file that contains <code>DAEMON_OPTS="--server REDACTED --factsync"</code> to return waitforcert back to the default, to bring down new facter facts, and to tell puppet where the master server is. That puppet file gets copied during the boostrap procedure, similarly to the cfengine update.conf. Earlier, I had incorrectly assumed that the waitforcert value would cause puppet to hang, but it just backgrounds itself and waits on the certificate to be signed.</p>
<p>As for cfengine setup, I defer to the articles at <a href="http://www.debian-administration.org/tag/cfengine">debian-administration.org</a>, as I don&#8217;t have much to add at this time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2007/05/06/the-gold-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Beginnings of Infrastructure Management</title>
		<link>http://blogs.cae.tntech.edu/mwr/2007/04/30/the-beginnings-of-infrastructure-management/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2007/04/30/the-beginnings-of-infrastructure-management/#comments</comments>
		<pubDate>Tue, 01 May 2007 01:33:18 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cfengine]]></category>
		<category><![CDATA[infrastructures]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/2007/04/30/the-beginnings-of-infrastructure-management/</guid>
		<description><![CDATA[Contents of this post have been moved to http://blogs.cae.tntech.edu/mwr/infrastructure-management/
]]></description>
			<content:encoded><![CDATA[<p>Contents of this post have been moved to <a href="http://blogs.cae.tntech.edu/mwr/infrastructure-management/">http://blogs.cae.tntech.edu/mwr/infrastructure-management/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2007/04/30/the-beginnings-of-infrastructure-management/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
