How to Install Puppet Master and Agent on RHEL derivatives – Rocky Linux , AlmaLinux, Oracle Linux

In this tutorial, we will learn how to install Puppet master and agent on RHEL derivatives hence this tutorial would work on RHEL , Rocky Linux, AlmaLinux and other forks.

Similar to Ansible and Chef, Puppet is an open-source configuration management technology developed by Puppet Labs that is intended to automate and centralize the setup of infrastructure, including servers. It facilitates the quick and easy completion of time-consuming, repetitive tasks that might otherwise be difficult.

Puppet has the following important features and uses a client-server architecture.

  • Puppet Master/Server: This node has all the settings needed to control client nodes that have the puppet slave installed on them.
  • The controlled client nodes in your environment are called Puppet Slave. Every slave has the Puppet agent installed and functioning, and they are all under the control of the Puppet master.
  • All of the data produced by Puppet is stored in a database called PuppetDB.

Regarding editions, in addition to open-source, Puppet Enterprise (PE) is available. Built on top of the open source Puppet framework, it is the commercial version of Puppet. You can control thousands of nodes’ configurations with both solutions. This is accomplished using the required state management in open-source Puppet.

Pre-requisite

  • A minimum of 2 cores and 4GB of RAM, or 4 cores and 4GBs of RAM, are required to support at least 1,000 nodes.
  • A recent RedHat-based Linux, such AlmaLinux, Oracle, or Rocky. The tutorial is made on Rocky Linux 8. You may refer the blog for any installation support How to Install Rocky Linux 8

Below is the IP and hostname of our setup :

  • Internet connection; • Terminal access; • At least non-root sudo user access;

Installing the Puppet Master Server

Upgrading the host

Let us upgrade the system to make sure its running on the latest version

We will need some tool/utility for further steps hence lets install them

Enable the required repo

On Rocky Linux, using Puppet’s official Yum repository makes it simple to acquire the most recent packages.

If your host server is behind any corporate network make sure you have the proxy enabled to connect to the Puppet Website

Reboot the system

Setting System Hostnames (FQDN)

Set the FQDN (Fully Qualified Domain name ) for the host which will serve as Puppet Master (Server)

Similarly set the FQDN for the host which will be serving as Puppet Slave

Set the hostnames and IP in the /etc/hosts file for resolution

Add the hostname along with server IP-address, for example

Where, 192.168.255.100 is the IP address of the Puppet Master Server

Installing & Configuring Puppet master

Now that we have the puppet repository installed we will now install the puppet master packages

Now open the new default configuration file for puppet master

Add the FQDN of the host as below

Apart from the above add the below lines for the certificates

Save and Exit and the file

For detailed configuration refer the official Puppet Settings Documentation

Allowing Firewall for Puppet

To make sure Puppet can readily connect with agents over the network, open the Puppet service in your system’s firewall.

Start the Puppet Master

We now have the server up and running with all the configurations finalized. Puppet master services won’t be operating by default; let’s start and activate them.

Adding Puppet to System Path

To utilize this tool’s command line, irrespective of the directory you are in, type:

Reload

Check the puppet version

Now switch to root to issue the certificate

List :

You can now test the puppet server with the local client

For all pending certificate (client) run the command to sign it

Installing Puppet Slave/agent (Client)

Installing repo and agent packages

We can now simply deploy Puppet agent on a remote Linux or Windows server if that is what you would like to accomplish.

Use the following commands for RPM systems, such as Redhat, CentOS, Rocky, Oracle Linux, and Almalinux:

For Ubuntu and Debian systems:

Ubuntu 22

Debian 12

Install the downloaded packages

Installing puppet agent

Start the service

Configuring Puppet agent

Edit the agent default file

Add the below lines to the above file

Save and Exit file

Edit the /etc/hosts file to add the IP and hostnames

Add the below lines

Save and exit the file

You can once again check on the Puppet Master node to check and sign the certificate (Run on master node as root )

Sign the certificate after identifying your client node (Run on master node as root )

Now you can test your client/slave

Conclusion

This puts this guide to a close. Using Rocky Linux 8 nodes in our configuration, we have shown in this post how to install Puppet Master and Agent on RHEL-based systems.

Leave a comment