Chapter 6. Applying Configuration on Clients
At this point, Satellite 6 Server’s Puppet ecosystem is configured and contains the mymodule
module. We now aim to apply this module’s configuration to a registered system.
6.1. Applying Configuration on Clients During Provisioning
We first define a new host’s Puppet configuration using the following procedure. This procedure uses the uploaded mymodule as an example.
Applying Configuration on Clients During Provisioning
- Navigate to Hosts > New host.
- Click the Host tab. Enter a Name for the host and choose the organization and location for the system. Choose the Lifecycle Environment and its promoted Content View. This defines the Puppet environment to use for the configuration. Also choose a Puppet CA and Puppet Master from the Capsule Settings. The chosen capsule acts as the server that controls the configuration and communicates with the agent on the new host.
Click the Puppet Classes tab and from the Available Classes section choose the Puppet classes that contain the configuration to apply. In our example, choose:
-
mymodule
-
mymodule:httpd
-
mymodule:app
-
-
Choose the necessary options from the Operating System tab. These options depend on your own Satellite 6 infrastructure. Make sure the Provisioning templates option includes the
Satellite Kickstart Default
kickstart template. This template contains installation commands for the Puppet agent on the new host. - Click the Parameters tab and provide any custom overrides to our Puppet class parameters. See Section 3.9, “Configuring Smart Class Parameters” to enable this feature.
- After completing all provisioning options, click Submit.
The provisioning process begins. Satellite 6 installs the required configuration tools as part of the Satellite Kickstart Default
provisioning template. This provisioning template contains the following:
<% if puppet_enabled %> # and add the puppet package yum -t -y -e 0 install puppet echo "Configuring puppet" cat > /etc/puppetlabs/puppet/puppet.conf << EOF <%= snippet 'puppet.conf' %> EOF # Setup puppet to run on system reboot /sbin/chkconfig --level 345 puppet on /usr/bin/puppet agent --config /etc/puppetlabs/puppet/puppet.conf -o --tags no_such_tag <%= @host.puppetmaster.blank? ? '' : "--server #{@host.puppetmaster}" %> --no-daemonize <% end -%>
This section performs the following:
- Installs the puppet package from the Red Hat Satellite Tools 6 repository.
- Installs the Puppet configuration snippet to the system at /etc/puppetlabs/puppet/puppet.conf.
- Enables the Puppet service to run on the system.
- Runs Puppet for the first time and initializes the node.
After the provisioning and configuration processes complete on the new host, access the host at the user-defined port in your web browser. For example, navigate to http://newhost.example.com:8120/
. The following message should appear in your browser:
Congratulations
Your puppet module has correctly applied your configuration.
6.2. Applying Configuration to Existing Clients
You might aim to have Puppet configuration applied to an existing client not provisioned through Red Hat Satellite 6. In this situation, install and configure Puppet on the existing client after registering it to Red Hat Satellite 6.
Register your existing system to Red Hat Satellite 6. For information on registering existing hosts, see Registering Hosts in the Managing Hosts guide.
The puppet
package is part of the Red Hat Satellite Tools 6 repository. Ensure you enable this repository before you proceed.
To Install and Enable the Puppet Agent:
- Open a terminal console and log in as root.
Install the Puppet agent:
# yum install puppet
Configure the Puppet agent to start at boot:
On Red Hat Enterprise Linux 6:
# chkconfig puppet on
On Red Hat Enterprise Linux 7:
# systemctl enable puppet
Configuring the Puppet Agent
Configure the Puppet agent by changing the /etc/puppetlabs/puppet/puppet.conf file:
# vi /etc/puppetlabs/puppet/puppet.conf
[main] # The Puppet log directory. # The default value is '$vardir/log'. logdir = /var/log/puppet # Where Puppet PID files are kept. # The default value is '$vardir/run'. rundir = /var/run/puppet # Where SSL certificates are kept. # The default value is '$confdir/ssl'. ssldir = $vardir/ssl [agent] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate
puppet
executable using the--loadclasses
# option. # The default value is '$confdir/classes.txt'. classfile = $vardir/classes.txt pluginsync = true report = true ignoreschedules = true daemon = false ca_server = satellite.example.com server = satellite.example.com environment = KT_Example_Org_Library_RHEL6Server_3 # Where puppetd caches the local configuration. An # extension indicating the cache format is added automatically. # The default value is '$confdir/localconfig'. localconfig = $vardir/localconfigImportantSet the
environment
parameter to the host’s Puppet environment from the Satellite Server. The Puppet environment label contains the organization label, life-cycle environment, content view name, and the content view ID. To see a list of Puppet environments in the Satellite 6 web UI, navigate to Configure > Environments.Run the Puppet agent on the host:
# puppet agent -t --server satellite.example.com
Sign the SSL certificate for the Puppet client through the Satellite Server web interface:
- Log in to the Satellite Server through the web interface.
- Select Infrastructure > Capsules.
- Click Certificates to the right of the required host.
- Click Sign.
Rerun the
puppet agent
command:# puppet agent -t --server satellite.example.com
When the Puppet agent is configured on the host it will be listed under All Hosts but only when Any Context is selected as the host will not be assigned to an organization or location.