Ubuntu

How to Install Puppet on Ubuntu 20.04

How to Install Puppet on Ubuntu 20.04

Introduction

Puppet is a fully accessible automated admin platform for remote server administration and managerial chores. This system operates on Linux, Unix, & Windows systems. We’ll go through how to deploy Puppet using Ubuntu 20.04 on both the master as well as client units in this guide.

Update system

You need to update your system apt package for better performance. Hence, try out the update query with sudo privileges in the shell as below. It requires adding a sudo password to proceed with the update. Add the password, and get started.

$ sudo apt-get update -y

Now, we have to update the /etc/hosts document on both the master and client node. Firstly we will update the master node using nano editor. You have to again add the password for your account.

$ sudo nano /etc/hosts

Now the file has been opened, write out the below lines in this file.

puppet-master-ip puppetmaster puppet

puppet-client-ip puppetclient

Install Puppet Server:

Now, it’s for the Puppet server to be installed. For this purpose, add the package repository of the puppet server by downloading it. Try out the below wget query to do so.

$ wget https://apt.puppetlabs.com/puppet6-release-focal.deb

Now you have to install the downloaded file using the dpkg command in the shell as below. Make sure to use sudo privileges to do so.

$ sudo dpkg –i puppet6-release-focal.deb

You need to install puppetserver first. Try out the below query within your console as follows:

$ sudo apt install puppetserver -y

It may take up to 12 minutes while installation. Hence, you have to relax for some time while it’s been completed. After the installation, you can go ahead.

Now the Puppet server has been installed on Ubuntu 20.04, it’s time to change its default size on your system. You have to open the default puppet server file and update it using the beneath query.

$ sudo nano /etc/default/puppetserver

Now the file is opened, change the “JAVA_ARGS” file as shown in the image below. Press Ctrl+S to save the changes. Come back to the terminal to continue again.

Start your puppet server using the systemctl command with the keyword “start” along with the name of the puppetmaster.

$ sudo systemctl start puppetserver

After the system has been started, you have to enable it as:

$ sudo systemctl enable puppetserver

You can see the puppet server status by using the below systemctl command in the shell. You can see that the puppet server is active and running perfectly.

$ sudo systemctl status puppetserver

Install Puppet Agent:

Now it’s time to mount the puppet agent in the client node. Hence login from the client node first and then add the below query to download the puppet file.

$ wget https://apt.puppetlabs.com/puppet6-release-focal.deb

Now install the download package using the dpkg package.

$ sudo dpkg –I puppet6-release-focal.deb

You have to install the puppet agent on your client node with the apt-get command:

$ sudo apt-get install puppet-agent-y

Now the puppet agent has been installed properly, you have to update its configuration file. Open this file in nano editor using the sudo command as follows:

$ sudo nano /etc/puppetlabs/puppet/puppet.conf

Now the file has been opened, add the below lines in it as shown in the image as well. Save the file and close it using Ctrl+S followed by Ctrl+X.

  • [main]
  • Certname = puppetclient
  • Server = puppetmaster

Now, again run the same systemctl commands to first start, and then enable the puppet.

$ sudo systemctl start puppet
$ sudo systemctl enable puppet

Now you can check the status of the puppet using the same status command. You can see it is actively running.

$ sudo systemctl status puppet

Conclusion:

This was all about the installation of a puppet server on both master and client nodes and how to connect them. Make sure to not miss any step. After these, make sure to sign the puppet agent node certificate for both the master and client-side.

Similar Posts