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 20.04 systems.
Prerequisites
- 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.
Install Puppet Agent on Ubuntu
Perform the following steps to install puppet agent on Ubuntu 20.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
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.
- 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:
106.16.14.230 puppetmaster puppet
106.16.18.104 puppetclient
106.16.18.105 puppetclientnew
2. On Client Node edit the hosts file by typing:
sudo nano /etc/hosts
Append you new server to the hosts files:
106.16.14.230 puppetmaster puppet
106.16.18.105 puppetclientnew
Here,
- 106.16.14.230 is the IP address of the master node.
- 106.16.18.104 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
- Download and install the latest version of Puppet on a client node:
wget https://apt.puppetlabs.com/puppet7-release-focal.deb
sudo dpkg -i puppet7-release-focal.deb
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
- 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
Conclusion
You have successfully installed Puppet Agent on Ubuntu 20.04 system. In this tutorial you learned how to install and configure Puppet Agent on client nodes.
Visit Puppet official documentation to know more about Puppet server node configuration and client node configuration.