In an ideal world, we would be able to provision our hosts and have things work consistently without problems every day ― but that is not the case because a system that is completely immune to all issues does not exist. In this hands-on lab, we explore the reasons why a node with the Puppet agent is unable to connect to our Puppet master. We will start this lesson by ensuring that there are no connection issues overall and then explore using the certificate authority to confirm if any conflicting certificates are preventing the node from connecting. Once the problem is tracked down, we will take the appropriate steps to fix the communication issue and connect our node to the Puppet master.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Replicate the Issue
Install Puppet on the
node1
Ubuntu node using the one-command installer:$ curl -k https://puppet.ec2.internal:8140/packages/current/install.bash | sudo bash
On the master, attempt to approve the cert:
$ sudo puppetserver ca sign –all
- Discover the Root of the Issue
Since we know that the node can connect to the Puppet master thanks to the installation command’s success, we know the issue isn’t related to a firewall or with any inter-node communications. So, let’s see if our
status
message for thepuppet
service tells us anything (make sure to work from thenode1
node):$ sudo systemctl status puppet | less
Now, from the master, list the available cert information:
$ sudo puppetserver ca list –all
The output informs us of a revoked certificate’s node that is identical to the one we’ve been working with. We’ve tracked down the problem!
- Solve the Issue
Clean the original cert from the master:
$ sudo puppetserver ca clean –certname node1.ec2.internal
Remove existing certificate information from the
node1
node:$ sudo -i
~# rm -r $(puppet agent –configprint ssldir)Generate new certs for the node:
~# puppet agent -t
Sign the cert on the master:
$ sudo puppetserver ca sign –certname node1.ec2.internal
It is optional, but we can confirm it worked by performing a puppet run against the node:
~# puppet agent -t