Installation and Configuration: Puppet Agent

Length: 00:07:43

Lesson Summary:

With the Puppet Server setup, we now want to provide agents for it to manage. We'll start by creating a CentOS 7 agent on the Cloud Playground. There are no size requirements, so a "micro"-sized server will work perfectly fine.

Prepare the Server (Optional)

We do not change the hostname in the course, but such tasks should be completed up-front if desired.

If you want to use a different hostname for the server than the one provided, set this now. For example, if I wanted to change this server to be web01:

# sudo hostnamectl set-hostname web01

We also need to update our /etc/hosts file to both add the hostname change if applicable and inform the server of the location of our Puppet Server:   localhost localhost.localdomain localhost4 localhost4.localdomain4 web01
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
# Cloud Server Hostname mapping    puppet

Add Puppet Repositories

We now want to add the Puppet 6.0 repository for RHEL-based distros:

# sudo rpm -Uvh

Next, run a yum update to enable the repository for use:

# sudo yum update

Install Puppet

To install Puppet on the agent server, all we have to do is run:

# sudo yum install puppet-agent

Then start up the service:

# sudo systemctl start puppet
# sudo systemctl enable puppet

Configure Puppet

The Puppet agent will automatically look for the server with the hostname puppet, so we actually have no configuration changes to make; if we wanted to change this, we would have to make changes within the /etc/puppetlabs/puppet/puppet.conf file, where all our Puppet agent-related configurations would be stored. For example, if we wanted to use our mylabserver hostname, we could update this to read:

server =

We could also use the puppet-config command-line utility:

# sudo /opt/puppetlabs/bin/puppet config set server

Approve Agent

With our agent ready, we can now go ahead and confirm the certificate on the Puppet Server. Before we log in to the Server, however, let's output the agent's certificate fingerprint:

# sudo puppet agent --fingerprint

Now, on the Puppet Server, let's see what we have to accept:

# puppetserver ca list

If the fingerprints match, we can approve the server:

# puppetserver ca sign --certname

This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More