Puppet is a popular open-source and automation admin engine. It can be used to manage large number of servers remotely and do administrative tasks from a master server. All the client of agent puppet nodes are managed by the server or master node. Before that, all the client nodes must have installed Puppet Agent server. This tutorial shows you step by step how to install Puppet Agent on Ubuntu 22.04 systems.
- You should have a installed and configured puppet master node.
- Should have a Ubuntu system with sudo privileges to setup as Puppet agent clients.
- The client system should connected to master node over public or private network.
How to Install Puppet Agent on Ubuntu 22.04
Perform the following steps to install puppet agent on Ubuntu 22.04 system:
Step 1 – Update Package List
Before starting the installation process, you should update the list of available packages by typing:
sudo apt-get update -y
sudo apt-get upgrade
Step 2 – Configure Hosts
With Puppet, master and client nodes communicate using hostnames. Before installing Puppet, you need to set up a unique hostname on each node.
1. On Puppet Master Node edit the hosts file by typing:
sudo nano /etc/hosts
2. Add the new server entries to the end of file:
184.108.40.206 puppetmaster puppet 220.127.116.11 puppetclient 18.104.22.168 puppetclientnew
2. On Client Node edit the hosts file by typing:
sudo nano /etc/hosts
Append you new server to the hosts files:
22.214.171.124 puppetmaster puppet 126.96.36.199 puppetclientnew
- 188.8.131.52 is the IP address of the master node.
- 184.108.40.206 is the IP address of the client node
Make sure, you should change IP address which your system have.
3. Save and close the file.
Step 4 – Install Puppet Agent
1. Download and install the latest version of Puppet on a client node:
sudo dpkg -i puppet7-release-jammy.de
2. Once you configured the PPA, Install the Puppet agent package on all client servers.
sudo apt update
sudo apt install puppet-agent -y
3. Open the Puppet configuration file once the installation finished:
sudo nano /etc/puppetlabs/puppet/puppet.conf
Add the following lines at the end of the Puppet configuration file to define the Puppet master node details:
[main] certname = puppetclientnew server = puppetmaster
Save your file and close it.
4. 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
5. Verify the Puppet agent service is running properly:
sudo systemctl status puppet
You will see a running status on all the agent systems.
Step 5 – Sign Puppet Agent Certificate
1. At this stage, you have completed all the configuration. Now, login to the master node and execute the following commands to get list of all available certificates:
sudo /opt/puppetlabs/bin/puppetserver ca list --all
2. Sign the certificates with:
sudo /opt/puppetlabs/bin/puppetserver ca sign --all
3. Finally, use the following command to test the communication between the master and client nodes:
sudo /opt/puppetlabs/bin/puppet agent --test
You have successfully installed Puppet Agent on Ubuntu 22.04 system. In this tutorial you learned how to install and configure Puppet Agent on client nodes.