Defining nodes and node grouping

In order to push a manifest, its classes, and assets to systems, they need to be known by Puppet Master. Grouping is practical if you want to push a manifest to a number of hosts without having to modify each configuration node.

How to do it…

In contrast to what the title wants you to believe, you cannot create a group and add nodes. However, you can group nodes and make them behave in a similar way to groups.

Nodes and node groups are defined in /etc/puppet/manifests/site.pp or a file at /etc/puppet/manifests/site.pp.

Create the configuration node

Create a /etc/puppet/manifests/site.pp/rhel7-client.pp file with the following contents:

node 'rhel7-client.critter.be' {
}

Create a node group

Create a /etc/puppet/manifests/site.pp/rhel7-clientgroup.pp file with the following contents:

node 'rhel7-client00.critter.be', 'rhel7-client01.critter.be', 'rhel7-client02.critter.be' {
}

There's more…

If you have a strict naming convention, you can use regular expressions to define your node group. Run the following commands:

node /^www[0-9]+.critter.be$/ {
}
node /^repo[0-9]+.critter.be$/ {
}

By default, node names are defined by their certificate name, which is FQDN (Fully Qualified Domain Name) of the system we used to register with Puppet Master.

If you don't remember the names of all of your nodes, you can easily find them at /var/lib/puppet/ssl/ca/signed/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset