Updated Multi-OS Puppet Configuration9 July 2012 · Filed in Explanation
I received some great feedback on my post about using Puppet with multiple operating systems. One of the suggestions was to do a better job of following the “official” Puppet style guide for syntax and file layout. With that in mind, I installed
puppet-lint on my Puppet master server using
apt-get install rubygems followed by
gem install puppet-lint.
puppet-lint, I was able to correct all “errors” in the manifest, but was left with one warning regarding line length. This is, as far as I know, an uncorrectable warning, as the line that
puppet-lint finds is the line that specifies the source of the OpenBSD packages. I can’t shorten the URL to the packages because that’s not under my control.
In any case, here’s the corrected Puppet manifests. I checked these with both
puppet parser validate and
puppet-lint, but if anyone has anything I’ve missed feel free to point it out in the comments. Unless otherwise stated, all files are placed in the
modules/ntp/manifests directory under the Puppet directory (which on my Puppet master server is
First up is the
Next we have the subclasses for the various operating systems. Here’s
Here’s the subclass for Ubuntu, stored in
And finally, here’s
centos.pp, used for CentOS/Red Hat-based instances:
I know that there are NTP modules for Puppet that “take care” of all this sort of thing for you, but creating this was, for me, part of the learning process. I’m going to tackle SSH next, and—per the comments on my first Puppet post—I’ve also started reading up on Hiera to see how that might fit in here. The initial reading I’ve done leads me to believe that the combination of Puppet and Hiera could be quite powerful.
As always, courteous comments are welcome. Feel free to speak up below!Tags: Automation · BSD · Interoperability · Linux · OSS · Puppet · UNIX Previous Post: Open Source Tools and Projects I Should Learn Next Post: Seeking Feedback on Infrastructure Coders Denver