Configuring Puppet's file server

Deploying configuration files is one of the most common uses of Puppet. Most non-trivial services need some kind of configuration file, and you can have Puppet push it to the client using a file resource as shown in the following code:

file { "/opt/nginx/conf.d/app_production.conf":
source => "puppet:///modules/app/app_production.conf",

The source parameter works like this: the first part after puppet:/// is assumed to be the name of a mount point, and the remainder is treated as a path to the file as shown.

puppet:///<mount point>/<path>

Usually the value of<mount point> is modules, as in the preceding example. In this case, Puppet will look for the file in:


modules ...

Get Puppet 2.7 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.