Puppet is an popular infrastructure management tool. With the help of Puppet server, you can easily manage a large number of servers from a master server. Puppet server node is responsible for managing multiple client node. Its necessary that all the client nodes must of Puppet Agent server installed and running.
Our previous tutorial describes you to configure Puppet master node on a Ubuntu 20.04 system along with client node. If you need to add more client server to existing Puppet network, just install the Agent server on the server.
This tutorial describes you step-by-step setup to install Puppet Agent on Ubuntu 20.04 system. Also helps you to connect a client node with master node.
Prerequisites
You must have:
- Assuming you already have Puppet master node.
- A running Ubuntu 20.04 system to setup as Puppet agent clients.
- Shell access to all systems with sudo privileged account.
- This system must be connected with master node over private or public network.
Step 1 – Configure Hosts
Puppet master and client nodes uses hostnames to communicate with each other. So its good to start with assigning a unique hostname for each node.
1. On Puppet Master Node – Login to the master node and edit /etc/hosts
file:
sudo nano /etc/hosts
Append the new server entries to the hosts file:
10.132.14.239 puppetmaster puppet 10.132.14.240 puppetclient1 10.132.14.241 puppetclient2
Assuming puppetmaster and puppetclient1 were already added in file. So just add new entry next to that lines.
2. On New Client Node – Next login to new Puppet agent server and edit /etc/hosts
file:
sudo nano /etc/hosts
Append you new server to the hosts files:
10.132.14.239 puppetmaster puppet 10.132.14.241 puppetclient2
Save you file and close it.
Step 2 – Install Puppet Agent on Ubuntu
Puppet debian packages are available under official Apt repository. You can configure the repository configuration file by installing a debian package on your system.
3. Now, download and install latest Puppet debian package to configure PPA on your client node:
wget https://apt.puppetlabs.com/puppet7-release-focal.deb
sudo dpkg -i puppet7-release-focal.deb
4. Once you configured the PPA, Install the Puppet agent package on all client servers.
sudo apt update
sudo apt install puppet-agent -y
5. Once the packages installation finished. Edit the Puppet configuration file:
sudo nano /etc/puppetlabs/puppet/puppet.conf
Add the following entries to the end of the Puppet configuration file to define the Puppet master node details:
[main] certname = puppetclient2 server = puppetmaster
Save your file and close it.
6. Next, start the Puppet agent service on all the client nodes and set it to auto-start on system boot:
sudo systemctl start puppet
sudo systemctl enable puppet
7. Once done, verify the Puppet agent service is running properly:
sudo systemctl status puppet
You should see a running status on all the agent systems
Step 3 – Sign the Puppet Agent Certificates
8. Your have done with the configuration’s. Now, login to the Puppet master node and run the following command to list all the available certificates:
sudo /opt/puppetlabs/bin/puppetserver ca list --all
9. Next, sign all the clients certificates using:
sudo /opt/puppetlabs/bin/puppetserver ca sign --all
10. Finally, test the communication between Puppet master and client nodes using the following command.
sudo /opt/puppetlabs/bin/puppet agent --test
Conclusion
That’s it. You have successfully installed Puppet agent on Ubuntu 20.04 system. Also configured new node with Puppet master node.
You can also visit the official documentation for more about Puppet server node configuration and client node configuration on