Access whitepaper

Puppet Revisited

Monday, February 16, 2009 by james litton
Over the next several days I will be creating a series of posts that describe how I am using Puppet. I wrote previously about why puppet sucks and further about how I'd rather being using chef, but alas, I am using puppet and it does get the job done.

The reason I am posting now is that I finally feel that I have a handle on how to effectively lay out configuration files and manage machines with puppet now. I hope that this information is useful to someone.

The first thing that you need to keep in mind is separate your configs as much as makes sense. For example, every service should have it's own config file. Here is my /etc/puppet heirarchy:

/etc/puppet/
/etc/puppet/puppet.conf
/etc/puppet/fileserver.conf
/etc/puppet/autosign.conf
/etc/puppet/manifests
/etc/puppet/manifests/users
/etc/puppet/manifests/users/virt_systems_users.pp
/etc/puppet/manifests/users/jlitton.pp
/etc/puppet/manifests/users/dmartin.pp
/etc/puppet/manifests/users/virt_dev_users.pp
/etc/puppet/manifests/users/developer.pp
/etc/puppet/manifests/users/virt_developer_user.pp
/etc/puppet/manifests/users/bmatheny.pp
/etc/puppet/manifests/groups
/etc/puppet/manifests/groups/develper.pp
/etc/puppet/manifests/groups/virt_wheel_group.pp
/etc/puppet/manifests/nodes.pp
/etc/puppet/manifests/services
/etc/puppet/manifests/services/varnish.pp
/etc/puppet/manifests/services/blog.pp
/etc/puppet/manifests/services/lvs.pp
/etc/puppet/manifests/services/sql.pp
/etc/puppet/manifests/services/presentation.pp
/etc/puppet/manifests/services/services.pp
/etc/puppet/manifests/services/xen.pp
/etc/puppet/manifests/services/daemon
/etc/puppet/manifests/services/daemon/postfix.pp
/etc/puppet/manifests/services/daemon/bacula-server.pp
/etc/puppet/manifests/services/daemon/apache.pp
/etc/puppet/manifests/services/daemon/mon.pp
/etc/puppet/manifests/services/daemon/nfs.pp
/etc/puppet/manifests/services/daemon/logrotate.pp
/etc/puppet/manifests/services/daemon/ssh.pp
/etc/puppet/manifests/services/daemon/bacula-client.pp
/etc/puppet/manifests/services/daemon/ntp.pp
/etc/puppet/manifests/services/daemon/stunnel.pp
/etc/puppet/manifests/services/daemon/syslog-ng.pp
/etc/puppet/manifests/services/daemon/ampstack.pp
/etc/puppet/manifests/services/daemon/yum.pp
/etc/puppet/manifests/services/daemon/snmp.pp
/etc/puppet/manifests/services/daemon/named.pp
/etc/puppet/manifests/services/daemon/memcache.pp
/etc/puppet/manifests/services/daemon/tftpd.pp
/etc/puppet/manifests/services/daemon/heartbeat.pp
/etc/puppet/manifests/services/daemon/dhcp.pp
/etc/puppet/manifests/services/daemon/mysql.pp
/etc/puppet/manifests/site.pp
/etc/puppet/manifests/os
/etc/puppet/manifests/os/redhat.pp
/etc/puppet/manifests/environments
/etc/puppet/manifests/environments/development.pp
/etc/puppet/manifests/environments/test.pp
/etc/puppet/manifests/environments/production.pp
/etc/puppet/manifests/templates
/etc/puppet/manifests/templates/base.pp
/etc/puppet/manifests/templates/xenguest.pp
Admittedly this could use some cleanup, but the point is if you are going to manage any significant number of machines, you need to start defining services from the beginning.

This may seem a bit chicken before the egg as it doesn't describe how to effectively use any of these files, but I'll post again shortly with an example nodes.pp and base.pp to help defining what a base class looks like.

Comments for Puppet Revisited

Thursday, February 19, 2009 by paul Matthews:
You may be better off taking a more modular approach and treating each service (ssh, apache, ntp) as a module rather than a class under the manifests directory. Here's how I lay things out:- ./templates ./templates/motd.erb ./templates/zones.erb ./puppet.conf ./manifests ./manifests/site.pp ./manifests/templates.pp ./manifests/nodes.pp ./manifests/classes ./manifests/classes/edit_file.pp ./manifests/classes/motd.pp ./manifests/site.pp.test ./manifests/os ./manifests/os/solaris.pp ./manifests/os/suse.pp ./manifests/os/redhat.pp ./modules ./modules/profile ./modules/profile/files ./modules/profile/files/sun_etc_profile ./modules/profile/files/sun_root_profile ./modules/profile/manifests ./modules/profile/manifests/init.pp ./modules/automount ./modules/automount/files ./modules/automount/files/autofs ./modules/automount/files/autofs_ldap_auth.conf ./modules/automount/files/auto.net ./modules/automount/files/automount.has-run ./modules/automount/files/auto.misc ./modules/automount/files/auto.smb ./modules/automount/files/auto.master ./modules/automount/files/auto_master ./modules/automount/files/nfs ./modules/automount/files/auto.home ./modules/automount/manifests ./modules/automount/manifests/init.pp ./modules/sshkeys ./modules/sshkeys/files ./modules/sshkeys/files/sshkeys.has-run ./modules/sshkeys/files/sun_etc_profile ./modules/sshkeys/files/sun_root_profile ./modules/sshkeys/files/.prompt ./modules/sshkeys/files/authorized_keys ./modules/sshkeys/manifests ./modules/sshkeys/manifests/init.pp ./modules/ntp ./modules/ntp/files ./modules/ntp/files/ntp.conf ./modules/ntp/manifests ./modules/ntp/manifests/init.pp ./modules/ldap ./modules/ldap/files ./modules/ldap/files/nsswitch.conf ./modules/ldap/files/authconfig ./modules/ldap/files/system-auth ./modules/ldap/files/ldap.conf ./modules/ldap/manifests ./modules/ldap/manifests/init.pp ./modules/patches ./modules/patches/files ./modules/patches/files/registration-profile ./modules/patches/files/patches.has-run ./modules/patches/manifests ./modules/patches/manifests/init.pp ./modules/tiv_tsm ./modules/apache ./modules/apache/files ./modules/apache/files/httpd.conf ./modules/apache/templates ./modules/apache/templates/virtual_host.erb ./modules/apache/manifests ./modules/apache/manifests/init.pp ./modules/apache/manifests/virtual_hosts.pp ./modules/apache/manifests/apache_files.pp ./modules/postfix ./modules/postfix/files ./modules/postfix/files/aliases.db ./modules/postfix/files/master.cf ./modules/postfix/files/main.cf ./modules/postfix/manifests ./modules/postfix/manifests/init.pp ./modules/postfix/manifests/postfix_files.pp ./modules/mysql ./modules/mysql/files ./modules/mysql/files/my.cnf ./modules/mysql/manifests ./modules/mysql/manifests/init.pp ./modules/virtualbox ./modules/virtualbox/files ./modules/virtualbox/files/ReadMe.txt ./modules/virtualbox/files/autoresponse ./modules/virtualbox/manifests ./modules/virtualbox/manifests/init.pp ./modules/zones ./modules/zones/files ./modules/zones/templates ./modules/zones/templates/zones.erb ./modules/zones/manifests ./modules/zones/manifests/init.pp ./modules/developer ./modules/developer/files ./modules/developer/manifests ./modules/developer/manifests/init.pp There's a few things under the manifests directory but generally those that are not large enough to justify module treatement. The advantage of going the module route is that any associated files with a service eg httpd.conf can be pulled in using source => puppet://apache/httpd.conf

Leave a comment





Captcha

Free Webinar

Using Blogs to Generate and Nurture Demand into Closed Business.

Hosted by Richard Cunningham, VP Marketing of Right On Interactive and Chris Baggott Co-founder, CEO of Compendium Blogware. Thursday, December 3rd 2009.
Sign up here »

Meet Our Team

Abby Brosmer-Rivera Ali Sales Brian Millis Chris Baggott Chantelle Flannery The Client Corner Dereck Martin James Litton Jennifer Buscher Jenni Edwards Jim Hyslop Jess Wehner Krystal Featherston Kaila Woodside Megan Glover Meghan Peters mikey mioduski P.J. Hinton Randy Cox Sarah Sedberry Chandra Chavez Julie Murphy

© 2009 Compendium Blogware
All Rights Reserved