Puppet is an open-source, cross-platform, enterprise automation tool that allows IT admins to automate infrastructure and complex workflows enabling continuous compliance in a simple, yet powerful way. Puppet can be set up in a client-server model that has multiple modules from Puppet orchestrator to Puppet Access to Code Manger and PuppetDB. This tutorial should not serve as complete documentation for Puppet implementation. Use other resources along with the guide below to get Puppet installed in your environment. To get started with Puppet in Ubuntu, follow the steps below:

Prepare Ubuntu

For this tutorial, we’re going to be using Ubuntu as our Puppet master or Puppet server. In this case, you’ll want to prepare Ubuntu to get Puppet working correctly. Run the commands below to open the Ubuntu hosts file. Then define or add the Puppet server and client IP in the file. For this tutorial, our Puppet server IP is 192.168.1.1, and the Puppet client IP is 192.168.1.2. Save the file and exit.

Add Puppet Repository

Now that the Ubuntu server has IP defined, run the commands below to add the Puppet 7 release repository. After that, run the commands below to install the repository.

Install Puppet Server

Now that the repository is installed, run the commands below to install Puppet Server. That should install the server on Ubuntu. After installing, the commands below can be used to stop, start and enable the server to automatically start up when the server boots. To validate that Puppet is installed and ready, run the commands below. That should display similar lines as shown below I you have Ubuntu firewall enabled then make sure to allow this port through the firewall.

Install Puppet Agent

Now that the server is installed, switch to the client node and install the Puppet client version on the node. For this tutorial, we’re going to be using an Ubuntu machine as our client node.  Puppet agents and the master servers communicate over an encrypted tunnel (HTTPS) with client verification. To install the Puppet client on Ubuntu, use the commands below to download and install the Puppet client repository. After installing the repository above, run the commands below to install the Puppet agent. On the client, run the commands below to open the Puppet configuration file. Then add the highlighted lines below to define the Puppet master server. You should make sure these hostnames are defined in the /etc/hosts file on the client. Save the exit. After installing, the commands below can be used to stop, start and enable the Puppet agent to automatically start up when the client boots. To verify that the Puppet agent is installed and running, run the commands below: That should display similar lines as shown below:

Sign Puppet Agent Certificates

Now switch back to the back to the server node and run the commands below to list all available certificates on the server. That should display lists of certificates found. Now run the commands below to sign all the certificates listed. That should do it! Now go back to the Puppet client node and run the commands below to test communication between client and server nodes. If communication is successful, then your job is done. You can now start configuring your server tasks. Conclusion: This post showed you how to install the Puppet server and client nodes on Ubuntu. If you find any error above, please use the form below to report. You may also like the post below: