Tuesday, February 2, 2021

How to install Puppet 7 on Ubuntu 18.0.4 | Puppet Master install Ubuntu 18.0.4 | Setup Puppet 7 on Ubuntu

Puppet is a configuration management tool, similar to Ansible, Chef and SaltStack. Puppet also can be used for automating infrastrcture as well.

  • Configuration management tool
  • Used for infrastructure automation as well 
  • An open source, written in Ruby
  • Uses Domain Specific Language (DSL) to describe system configuration
  • Comes in two version - Open source & Puppet Enterprise 
  • Puppet is based in client/server model.  
The server does all the automation of tasks on nodes/servers that have a client(agent) installed. The work of the Puppet agent is to send facts to the puppet master and request a catalog based on certain interval level(default time 30 mins). Once it receives a catalog, Puppet agent applies it to the node by checking each resource the catalog describes. It makes relevant changes to attain the desired state. The work of the Puppet master is to control configuration information.  Each managed agent node requests its own configuration catalog from the master.

We will see how to setup Puppet Master in Ubuntu 18.0.4.

Watch the steps for setting up Puppet Master:

Install Puppet master on new Ubuntu with medium instance
port 8140 needs to be opened.

First let us see how to install Puppet 7.x on Ubuntu 18.0.4.

Steps for Puppet Master Installation
Modify Puppet Master Hosts file to add hostname of Puppet Master
sudo vi /etc/hosts

Download puppet installables

sudo curl -O https://apt.puppetlabs.com/puppet7-release-bionic.deb
sudo dpkg -i puppet7-release-bionic.deb
sudo apt-get update

Install Puppet

sudo apt-get install puppetserver -y

sudo systemctl enable puppetserver.service


(the above command is to start the service during starting the Ubuntu instance)

Start Puppet Server

sudo systemctl start puppetserver.service  

(The above command is for starting the server and this may take some time)         

sudo systemctl status puppetserver.service

Now press q to come out of window.
Add puppet master ip address and puppet next to it like shown below

This confirms that Puppet Master is installed successfully.

Verify which version of Puppet installed by executing below command:
apt policy puppetserver

Set Puppet into Path
sudo cp /opt/puppetlabs/bin/puppet /usr/bin/ -v
sudo cp /opt/puppetlabs/puppet/bin/gem  /usr/bin/ -v

Check Puppet version
puppet --version
It should displays something like below:

Install AWS SDK Gems
You need to install the aws-sdk-core and retries gems as root (or superuser):
sudo gem install aws-sdk-core retries
Done installing documentation for retries after 0 seconds
6 gems installed
Also install AWS SDK for accessing resources in AWS
sudo gem install aws-sdk -v 2.0.42

Done installing documentation for retries after 0 seconds
4 gems installed
Install puppet-labs-aws module
sudo puppet module install puppetlabs-aws

That's it. Puppet Master is setup successfully!!!! You can watch the above steps in YouTube as well. 

1 comment:

  1. Why so old Ubuntu version?

    If you don't want to work wit the PATH variable, better use the symbolic links:
    sudo ln -sf /opt/puppetlabs/bin/puppet /usr/bin/
    sudo ln -sf /opt/puppetlabs/puppet/bin/gem /usr/bin/


Automate Azure App Service setup using Ansible and Azure DevOps pipeline | How to integrate Ansible with Azure DevOps | How to Create WebApp in Azure Cloud using Ansible

Ansible is an open-source, configuration management tool that automates cloud provisioning, configuration management, and application deploy...