<?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>Coherent Ramblings &#187; Philosophy</title>
	<atom:link href="http://plathrop.tertiusfamily.net/blog/category/philosophy/feed/" rel="self" type="application/rss+xml" />
	<link>http://plathrop.tertiusfamily.net/blog</link>
	<description>My thoughts on everything from Operations through Parenting and beyond.</description>
	<lastBuildDate>Thu, 03 Jun 2010 17:12:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Naming Is A Hard Problem</title>
		<link>http://plathrop.tertiusfamily.net/blog/2009/01/20/naming-is-a-hard-problem/</link>
		<comments>http://plathrop.tertiusfamily.net/blog/2009/01/20/naming-is-a-hard-problem/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 22:27:06 +0000</pubDate>
		<dc:creator>plathrop</dc:creator>
				<category><![CDATA[Digg]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[naming philosophy puppet]]></category>

		<guid isPermaLink="false">http://plathrop.tertiusfamily.net/blog/?p=31</guid>
		<description><![CDATA[What should you name your hosts?

I used to believe this was an easy problem. Pick a theme, like <a href="http://en.wikipedia.org/wiki/List_of_Star_Wars_characters">Star Wars Characters</a> or <a href="http://en.wikipedia.org/wiki/List_of_constellations">Constellations</a>, and then name machines based on that theme: "chewbacca.tertiusfamily.net" for example. Use DNS CNAMEs to point your "functional" names (webapp1, or db1 or whatever) at the theme name and you're off. Then I started working for <a href="http://digg.com">Digg</a>.]]></description>
			<content:encoded><![CDATA[<p>What should you name your hosts?</p>
<p>I used to believe this was an easy problem. Pick a theme, like <a href="http://en.wikipedia.org/wiki/List_of_Star_Wars_characters">Star Wars Characters</a> or <a href="http://en.wikipedia.org/wiki/List_of_constellations">Constellations</a>, and then name machines based on that theme: &#8220;chewbacca.tertiusfamily.net&#8221; for example. Use DNS CNAMEs to point your &#8220;functional&#8221; names (webapp1, or db1 or whatever) at the theme name and you&#8217;re off. Then I started working for <a href="http://digg.com">Digg</a>.</p>
<p><a href="http://blog.digg.com/?p=168">Digg&#8217;s infrastructure</a> is massively horizontally-scaled. That means clusters, which means *lots* of individual nodes. No matter what &#8220;theme&#8221; you choose, you run out of names awfully fast. Not only that, but when you start building out a service-oriented architecture, you stop wanting to deal with individual nodes and start thinking in terms of clusters which provide services instead.</p>
<p>At the Puppet training I went to in Portland, we discussed the issue and I found out that there are two camps (well, as many camps as there are sysadmins, but it can be broken down into two camps). On the one side are those who want to put meta-data into their hostnames. On the other are those who think that hostnames should be as arbitrary as possible. There are strong arguments either way.</p>
<p>I <em>think</em> I come down firmly on the side of arbitrary hostnames. I&#8217;m coming to believe that, since IP addresses are necessarily unique, they should be the only unique identifier for an individual node. But I can&#8217;t come up with a solid argument as to why that is the best way.</p>
<p>What do you do about naming?</p>
]]></content:encoded>
			<wfw:commentRss>http://plathrop.tertiusfamily.net/blog/2009/01/20/naming-is-a-hard-problem/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Creating Puppet Modules</title>
		<link>http://plathrop.tertiusfamily.net/blog/2008/04/18/creating-puppet-modules/</link>
		<comments>http://plathrop.tertiusfamily.net/blog/2008/04/18/creating-puppet-modules/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 23:56:09 +0000</pubDate>
		<dc:creator>plathrop</dc:creator>
				<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[Puppet]]></category>

		<guid isPermaLink="false">http://plathrop.tertiusfamily.net/blog/2008/04/18/creating-puppet-modules/</guid>
		<description><![CDATA[In Puppet parlance, a module is a collection of manifests (including classes and definitions), templates, and files which, taken together, describe a recipe for configuring something via Puppet. Puppet has a number of facilities which make modules incredibly useful and labor-saving.
Modules have a standard internal organization which is described in detail on the ModuleOrganisation wiki [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://puppet.reductivelabs.com">Puppet</a> parlance, a <a href="http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms#module">module</a> is a collection of <a href="http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms#manifest">manifests</a> (including <a href="http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms#class">classes</a> and <a href="http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms#definition">definitions</a>), <a href="http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms#templates">templates</a>, and files which, taken together, describe a recipe for configuring something via Puppet. Puppet has a number of facilities which make modules incredibly useful and labor-saving.</p>
<p>Modules have a standard internal organization which is described in detail on the <a href="http://reductivelabs.com/trac/puppet/wiki/ModuleOrganisation">ModuleOrganisation</a> wiki page. A trivial module can be as simple as a <samp>manifests</samp> directory containing only a single manifest: <samp>init.pp</samp>. However, as modules grow more complex, you&#8217;ll want to break up your manifests and add templates in a <samp>templates</samp> directory, files in a <samp>files</samp> directory, and a <samp>README</samp> file which explains how to make use of your module.</p>
<p>I&#8217;m in the process of polishing up several modules, including LDAP, Kerberos, memcached, and ntp modules. In some ways, I&#8217;m duplicating work; several implementations of these modules are available. However, Puppet modules are still evolving, and I wanted to try my hand at module writing. Also, the existing modules did not work quite right for us. Some of them fail to properly isolate site-specific information from the recipe, for example. Others had complex interdependencies that I didn&#8217;t like.</p>
<p>There are several techniques that I think will evolve as &#8220;best practices&#8221; for Puppet module design. These are:</p>
<ol>
<li>Keep site-specific customization out of your modules.
<li>Your module should implement a minimal working configuration &#8220;out of the box&#8221;.
<li>Use variables to make it easier to patch your module for use on other platforms.
<li>Break a module up into sensible classes and defined types to make it easy to customize via inheritance.
<li>Use <samp>init.pp</samp> for module-wide variables and/or common functionality, but break all other classes/defines into separate files.
</ol>
<p>Let&#8217;s take a look at each of these in detail:</p>
<h3>Keep site-specific customization out of your modules.</h3>
<p>Modules are, at heart, meant to be shared with others. Try to write your modules so they are as site-neutral as they can be. Use variables that can be set in a higher-level scope like <samp>site.pp</samp> to control how the module works, instead of baking your site&#8217;s settings into the module. For example, in my LDAP module I do this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> ldap::common <span style="color:#006600; font-weight:bold;">&#123;</span>
  <span style="color:#9966CC; font-weight:bold;">case</span> <span style="color:#ff6633; font-weight:bold;">$ldap_base_dn</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#996600;">&quot;&quot;</span>: <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff6633; font-weight:bold;">$ldap_base_dn</span> = <span style="color:#996600;">&quot;dc=example,dc=com&quot;</span>
      warning<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;ldap_base_dn not set, using default $ldap_base_dn&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">case</span> <span style="color:#ff6633; font-weight:bold;">$ldap_admin_dn</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#996600;">&quot;&quot;</span>: <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff6633; font-weight:bold;">$ldap_admin_dn</span> = <span style="color:#996600;">&quot;cn=admin,$ldap_base_dn&quot;</span>
      warning<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;ldap_admin_dn not set, using default $ldap_admin_dn&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">case</span> <span style="color:#ff6633; font-weight:bold;">$ldap_admin_password</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#996600;">&quot;&quot;</span>: <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#CC0066; font-weight:bold;">fail</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;ldap_admin_password not set!&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Then, in <samp>site.pp</samp>, I set the variables appropriately:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Site Variables</span>
<span style="color:#ff6633; font-weight:bold;">$ldap_server</span>           = <span style="color:#996600;">&quot;ash001.example.com&quot;</span>
<span style="color:#ff6633; font-weight:bold;">$ldap_admin_password</span>   = <span style="color:#996600;">&quot;testing&quot;</span>
<span style="color:#ff6633; font-weight:bold;">$ldap_base_dn</span>          = <span style="color:#996600;">&quot;dc=example,dc=com&quot;</span></pre></div></div>

<h3>Your module should implement a minimal working configuration &#8220;out of the box&#8221;.</h3>
<p>This principle is also tied in with the fact that modules were meant to be shared. When someone is looking for a module, they are going to want something that works with little-to-no configuration, because this will give them confidence that the module will work once it is fully configured. Just like full-blown pieces of software, if a module doesn&#8217;t have an easy initial setup, people will get confused as to whether or not it even works. My LDAP module provides a <samp>ldap::master</samp> class which implements a very basic configuration: the slapd package is installed, a working configuration file is set up (without SSL or any of the other goodies), and the service is started. If the user sets just one variable, <samp>$ldap_admin_password</samp> in their <samp>init.pp</samp> and includes <samp>ldap::master</samp> on a node, they will be able to verify that LDAP is up and running with an example configuration. Even better, if they set the other variables, this configuration will be customized to their site with little effort on their part. It might be better to add in all the bells and whistles (SSL at a minimum), but I&#8217;m not sure yet where I stand on that.</p>
<h3>Use variables to make it easier to patch your module for use on other platforms.</h3>
<p>Currently, in the <samp>init.pp</samp> of my LDAP module, I set variables like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#ff6633; font-weight:bold;">$ldappackage</span>       = <span style="color:#996600;">&quot;slapd&quot;</span>
  <span style="color:#ff6633; font-weight:bold;">$ldapservice</span>       = <span style="color:#996600;">&quot;slapd&quot;</span>
  <span style="color:#ff6633; font-weight:bold;">$ldapdir</span>           = <span style="color:#996600;">&quot;/etc/ldap&quot;</span>
  <span style="color:#ff6633; font-weight:bold;">$ldaputilpackage</span>   = <span style="color:#996600;">&quot;ldap-utils&quot;</span>
  <span style="color:#ff6633; font-weight:bold;">$ldapclientpackage</span> = <span style="color:#996600;">&quot;libnss-ldap&quot;</span></pre></div></div>

<p>and use them like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  package <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#ff6633; font-weight:bold;">$ldappackage</span>:     <span style="color:#9966CC; font-weight:bold;">ensure</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> installed;
  <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
  file <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">&quot;$ldapdir/slapd.conf&quot;</span>:
    content <span style="color:#006600; font-weight:bold;">=&gt;</span> template<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;ldap/slapd.conf.erb&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,
    <span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> Package<span style="color:#006600; font-weight:bold;">&#91;</span>$ldappackage<span style="color:#006600; font-weight:bold;">&#93;</span>,
    notify  <span style="color:#006600; font-weight:bold;">=&gt;</span> Service<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;$ldapservice&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
  service <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff6633; font-weight:bold;">$ldapservice</span>:
    <span style="color:#CC0066; font-weight:bold;">require</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span> Package<span style="color:#006600; font-weight:bold;">&#91;</span>$ldappackage<span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#CC00FF; font-weight:bold;">File</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;$ldapdir/slapd.conf&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#93;</span>,
    <span style="color:#9966CC; font-weight:bold;">ensure</span>    <span style="color:#006600; font-weight:bold;">=&gt;</span> running,
    enable    <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,
  <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>These variables are set up for Debian now, because that is the distribution I&#8217;ve standardized on. If later I (or someone I&#8217;ve shared the module with) wants to add support for another distribution, they can set up case statements, and not have to modify the rest of the module!</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">case</span> <span style="color:#ff6633; font-weight:bold;">$operatingsystem</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
    debian: <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldappackage</span>       = <span style="color:#996600;">&quot;slapd&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldapservice</span>       = <span style="color:#996600;">&quot;slapd&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldapdir</span>           = <span style="color:#996600;">&quot;/etc/ldap&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldaputilpackage</span>   = <span style="color:#996600;">&quot;ldap-utils&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldapclientpackage</span> = <span style="color:#996600;">&quot;libnss-ldap&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
    centos: <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldappackage</span>       = <span style="color:#996600;">&quot;openldap&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldapservice</span>       = <span style="color:#996600;">&quot;slapd&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldapdir</span>           = <span style="color:#996600;">&quot;/etc/openldap&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldaputilpackage</span>   = <span style="color:#996600;">&quot;openldap-utils&quot;</span>
      <span style="color:#ff6633; font-weight:bold;">$ldapclientpackage</span> = <span style="color:#996600;">&quot;libnss-ldap&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p><em>I have not tested this, as I don&#8217;t use CentOS, so don&#8217;t use these!</em></p>
<h3>Break a module up into sensible classes and defined types to make it easy to customize via inheritance.</h3>
<p>Since you&#8217;ve pulled all the site-specific customization out of your package, and you are providing a minimal working configuration, people are going to want to do other things with your module that are appropriate to their site. If you have everything lumped into one big &#8220;ldap&#8221; class, this is going to be difficult for them. I break thinks up into <samp>ldap::common</samp> for things common to all the other classes, <samp>ldap::client</samp> for things needed to query the LDAP servers, <samp>ldap::master</samp> for the primary LDAP server, and later I&#8217;ll provide <samp>ldap::slave</samp> for replication slaves.</p>
<h3>Use <samp>init.pp</samp> for module-wide variables and/or common functionality, but break all other classes/defines into separate files.</h3>
<p>This is for your sanity as well as the sanity of those who might want to modify your module. I started with everything in one big <samp>init.pp</samp> file and it rapidly went out of control. Puppet does some awesome automagical lookups that you can take advantage of. For example, my <samp>ldap::master</samp> class is defined in a file called <samp>master.pp</samp>; when someone tries to load <samp>ldap::master</samp>, Puppet automatically searches for a <samp>.pp</samp> file named &#8220;master&#8221; in the &#8220;ldap&#8221; module!</p>
<p>So far, this is all the wisdom I have to impart on the subject. I&#8217;ll be sure to post links here when these modules are ready for prime-time.</p>
]]></content:encoded>
			<wfw:commentRss>http://plathrop.tertiusfamily.net/blog/2008/04/18/creating-puppet-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Background</title>
		<link>http://plathrop.tertiusfamily.net/blog/2007/12/08/some-background/</link>
		<comments>http://plathrop.tertiusfamily.net/blog/2007/12/08/some-background/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 23:05:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Philosophy]]></category>

		<guid isPermaLink="false">http://plathrop.tertiusfamily.net/blog/?p=15</guid>
		<description><![CDATA[I thought I&#8217;d write an introductory post to tell you a little about myself. I&#8217;ve been working professionally in the world of systems administration for seven years. My focus is on Unix variants such as BSD and Linux, but I am a generalist as opposed to a specialist; I have administered Windows systems, Macs, and [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d write an introductory post to tell you a little about myself. I&#8217;ve been working professionally in the world of systems administration for seven years. My focus is on Unix variants such as BSD and Linux, but I am a generalist as opposed to a specialist; I have administered Windows systems, Macs, and even a few oddballs like NeXT and BeOS. If you&#8217;d like to see more about my experience, take a look at my resume (<a href="http://plathrop.tertiusfamily.net" title="http://plathrop.tertiusfamily.net">http://plathrop.tertiusfamily.net</a>).</p>
<p>I have a growing passion for automation and a people-centered view of systems administration. To me, a systems administrator&#8217;s primary goal should be to act as a mediator between people and the technological systems which exist to support them. That&#8217;s right, I feel our profession is about people, not about computers! Although this is a somewhat radical view in our &#8220;community&#8221;, I apparently share it with a few others such as <a href="http://www.madstop.com/">Luke Kanies</a> (developer of the extremely awesome configuration management tool <a href="http://puppet.reductivelabs.com">Puppet</a>).</p>
<p>I think that our profession is entering a period of transition which has much in common with the recent changes in the world of software development; much as &#8220;coders&#8221; became &#8220;software engineers&#8221;, &#8220;sysadmins&#8221; are becoming &#8220;systems engineers&#8221; &#8211; or at least we should be if we wish to remain relevant. That change will be accompanied by a growing body of tools, standards, and best practices &#8211; and it is time for professional administrators to start thinking hard about what we want these to look like. Part of the reason I started this blog is to put my thoughts out there and hopefully start this conversation.</p>
]]></content:encoded>
			<wfw:commentRss>http://plathrop.tertiusfamily.net/blog/2007/12/08/some-background/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
