Pulling Strings With Puppet - James Turnbull [4]
One of the first open source configuration management tools, released in 1993, it also has a client-server model and is commonly used in educational institutions.
• LCFG(http://www.lcfg.org/):
A client-server configuration management tool that uses XML to define configuration.
• Bcfg2 (http://trac.mcs.anl.gov/projects/bcfg2):
A client-server configuration management tool written in Python. It uses specifications and the client responses to configure target hosts.
This book focuses on implementing and using one of these open source products, Puppet, to manage the configuration of your hosts, applications, daemons, and services.
What Is Puppet?
Puppet is an open source Ruby-based systems and configuration management tool relying upon a client-server deployment model. It is licensed using the GPLv2 license and is principally developed by Luke Kanies. Kanies has been involved in Unix and systems administration since 1997, and Puppet has developed from that experience. Unsatisfied with existing configuration management tools, Karnes began working in tool development in 2001 and in 2005 founded Reductive Labs, an open source development house focused on automation tools. Shortly after this, Reductive released their flagship product, Puppet.
What Makes Puppet Different?
Many systems and configuration management products, for example, cfengine, work in a similar manner. So what makes Puppet different? Puppet's defining characteristic is that it speaks the local language of your target hosts. This allows Puppet to define systems administration and configuration tasks with generic instructions on the Puppet server. These instructions are often called recipes.
Puppet's recipe syntax allows you to create a single script that allows you to create a user on all your target hosts. In turn, this recipe is interpreted and executed on each target host using the correct local syntax for that host. For instance, if the recipe is executed on a Red Hat Linux server, the user would be created with the useradd command. If the same recipe is executed on a FreeBSD target, the adduser command would be executed. Because Puppet recipes are so portable, community members and contributors share recipes for a variety of activities on the Puppet website, mailing list, and IRC channel!
The next area Puppet excels in is flexibility. As a result of its open source nature, you always have free access to Puppet's source code, meaning if you have a problem and you have the skills to do so, you can alter or enhance Puppet's code to suit your environment. Additionally, community developers and contributors regularly enhance and add to the functionality of Puppet. A large community of developers and users also contribute to providing documentation and support for Puppet.
Puppet is also readily extensible. Functions to support custom packages and configuration unique to your environment can be quickly and easily added to your Puppet installation. In addition, the Puppet community regularly adds code and packages that you can modify or incorporate into your environment.
I'll show you just how easy this is in Chapter 7. These additions can also be readily made without changing the core Puppet code, allowing you a clear upgrade and support path as Puppet develops.
Finally, Puppet makes use of another Ruby-based tool, Facter (http://reductivelabs.com/projects/facter/). Facter is a system analysis tool that allows you to query and return information about hosts that you can use in your Puppet configuration as variables. This means you can write generic configuration instructions and use Facter-returned variables to ensure the right values are configured on the right host. This precludes the need for external databases, configuration files, or directories. I'm going to look at Facter in more detail in Chapter 3 and how to add your own "facts" in Chapter 7.
How Does Puppet work?
With Puppet, central servers, called Puppet masters, are installed and configured. Client software is then installed on the target hosts, called puppets or nodes,