Online Book Reader

Home Category

Pulling Strings With Puppet - James Turnbull [14]

By Root 345 0
the binary being executed; for example, the puppetd binary will set all options in the [puppetd] namespace.

You can also see in Listing 2-4 that you can reuse previously defined options in other configuration options by prefixing them with $. For example, we defined the vardir option in the main section and then reused this value as part of the localconfig option in the puppetd section.

$vardir/localconfig

You can also use any configuration option from the Puppet configuration file on the command line by prefixing it with - -. So to specify the vardir option on the command line, we would specify --vardir as an argument. Boolean configuration options are specified on the command line using an on/off model like so:

In the first line, the trace option is set on, and in the second line, it is disabled by prefixing the option with no-.

By default, Puppet binaries will look for their configuration in a file located in the /etc/puppet/ directory. From version 0.23.0 of Puppet, each binary looks for a configuration file called puppet. conf in /etc/puppet. In previous versions, each Puppet binary looked for separate files, i.e., the Puppet master daemon looks for the puppetmasterd.conf file, the client for puppetd. conf, and the Puppet Certificate Authority for puppetca.conf.

This transition to a single configuration file is aided by the use of the --genconfig option. You can execute each of the Puppet binaries with this flag and a commented, default configuration file will be outputted, and the binary will exit. You can pipe this output into a file to create a configuration file like so:

The resulting output makes an excellent starting point for an initial Puppet configuration. In this chapter, we're going to focus on running and configuring three of the Puppet binaries; their configuration file options, puppetmasterd, puppetd, and puppetca; and the options contained in the general [main] section of the configuration file. We'll touch on the other binaries and configuration options in later chapters.

Tip - You can see a full list of all configuration options and their functions at http://www.reductivelabs.com/trac/puppet/wiki/ConfigurationReference.

The [main] Configuration Namespace

Every Puppet binary will check the configuration file and set any configuration options found in the [main] namespace in your Puppet configuration file. These variables set the high-level options that control Puppet's environment, such as the location of the configuration directory. In Table 2-8, I've listed some of the key options you can configure in the [main] namespace.

The first options in Table 2-8 specify the location of a variety of Puppet resources. The confdir options tells Puppet where to look for configuration files. The value of this option is used as a default for other directory locations; for example, the default directory for SSL certificates, specified using the ssldir option, is $confdir/ssl. The default value for this option is dependent on the user that is executing Puppet. If the user is root or the user specified in the user option (in the [puppetmasterd] namespace), it defaults to /etc/puppet; otherwise, it defaults to -.

Other directories that can be specified include the vardir for dynamic Puppet data and the logdir option that specifies the location of Puppet log files. Also configurable are the Puppet state directory and state file using the statedir and statefile options, respectively. The Puppet state directory and file hold the current state of running configuration, and the state file stores the state in YAML (a recursive acronym for YAML Ain't Markup Language- http : //yaml . org) format.


The trace option turns on stack tracing for some Puppet errors. It is a Boolean option and defaults to false. The filetimeout option specifies how often in seconds Puppet will check for updates in configuration files; it defaults to 15 seconds. The last option in Table 2-8 allows you to set the syslog facility that Puppet will use. It defaults to daemon.

Note -► Puppet also has support for multiple environments,

Return Main Page Previous Page Next Page

®Online Book Reader