The initial manifest to start out with should at least define the following:
Set the server to use throughout the manifest:
$server = "master.puppetmanaged.org"
In site.pp
, you should import classes/modules.pp
:
import "classes/modules.pp"
What is in classes/modules.pp
exactly is up to you. Note that importing too many modules doesn't hurt, but you should import the least amount of modules and thus only those that you use.
In site.pp
, you should import utils/*.pp
:
import "utils/*.pp"
What files are in utils/
and what they define is up to you.
In site.pp
, you should import modules/*.pp
:
import "modules/*.pp"
What files are in /etc/puppet/manifests/modules/
depends on the modules you want or need to use in your environment, and we recommend the files only hold a single import statement for the appropriate module (and any requirements should the module have any). Import only the modules that you use, and any modules that are required by other modules.
By importing nodes/*.pp
, you include all node configuration you place in /etc/puppet/manifests/nodes/
:
import "nodes/*.pp"
By importing groups/*.pp
, you include all node-group configuration you place in /etc/puppet/manifests/groups/
import "groups/*.pp"
By importing services/*.pp
, you include all service configuration you place in /etc/puppet/manifests/services/
import "services/*.pp"
The "default" node applies to all nodes that have do not have a node configuration (yet). The default node should always have a minimal configuration, and a notice to indicate this node is using the default configuration. A default node declaration could look like this:
node default { notice("Node $fqdn is using the default configuration!") }
By including the client
class from the puppet
module, you can start managing puppet via puppet:
include puppet::client
By including the master
class from the puppet
module, you can start managing the puppetmaster via puppet:
include puppet::master
Given the above, a default site.pp could look similar to:
$server = "master.puppetmanaged.org" import "classes/*.pp" import "modules/*.pp" import "nodes/*.pp" import "groups/*.pp" import "services/*.pp" # Always include the puppet::client class include puppet::client # The default node node default { notice("Node $fqdn uses a default configuration") } # The puppetmaster should include the puppet::master class node 'master.puppetmanaged.org' { include puppet::master }