Once you define modules and nodes, you can start deploying the modules to your nodes. You can do this on various levels, which will be demonstrated in the following recipe.
In order to deploy a module (or manifest) to a node, your must configure this in the node's stanza or a group of nodes that the node belongs to, or you can define it on the base level to apply it to every node.
Edit the client configuration node from the previous recipe and add an include statement referring to manifest you want to be applied to the client block. You can execute the following command for this:
node 'rhel7-client.critter.be' { include ntp }
In the same way you edited the single node file, edit the node group configuration file and add an include statement to the node group block referring to the manifest you want applied. Take a look at the following command:
node 'rhel7-client0.critter.be', 'rhel7-client1.critter.be', 'rhel7-client2.critter.be' { include ntp }
For testing purposes, there's an alternative to defining nodes and including modules.
Copy the manifest(s), files, and templates to your test machine (usually, you will develop elsewhere than the production Puppet Master anyway) and execute them in the following way:
~]# puppet apply /path/to/manifest.pp
By default, Puppet applies all manifests found in /etc/puppet/manifests/site.pp
. As explained in the preceding section, this doesn't need to be a single monolithic file containing all your directives. When using it as a directory, it uses all the manifests found within this directory, or if the name of a subdirectory ends with .pp
, it interprets all of its contents as manifests as well. It interprets all files alphanumerically.