Your browser does not support Javascript!
H E L P D I C E

How to install puppet architecture on Linux

How to install puppet architecture on Linux ( 6 min Read )



Ad

Puppet is an open source software configuration management and deployment tool. It's most commonly used on Linux and Windows to pull the strings on multiple application servers at once. Like other DevOps programs, Puppet does more than automate system administration. It changes the human workflow, and enables developers and system administrators to work together. Programmers can write, test, and launch applications without waiting on Ops staff to deliver the resources needed.

Installing Puppet Server

Puppet Server is the software that pushes configuration from the Puppet master to the other servers. It runs only on the Puppet master; the other hosts will run the Puppet Agent.

Step 1: Get the puppet installation package from its repository using wget command.

 command:  wget https://apt.puppetlabs.com/puppet-release-bionic.deb

Step 2: Make the package ready for installation using dpkg command.

 command:  sudo dpkg -i puppet-release-bionic.deb

Step 3: To ensure every dependicies are installed and updated.

 command:  sudo apt-get update

Step 4: Install the puppet master 

 command:  sudo apt-get install puppetmaster

Step 5: To check puppet master is running .

 command:   sudo systemctl status puppet-master.service

Step 5: Configure memory allocation

By default, Puppet Server is configured to use 2 GB of RAM. You can customize this setting based on how much free memory the master server has and how many agent nodes it will manage.

To customize it, open /etc/default/puppetmaster:

 command:  sudo vim /etc/default/puppetmaster

Then find the JAVA_ARGS line, and use the -Xms and -Xmx parameters to set the memory allocation. We’ll increase ours to 3 gigabytes:

Write JAVA_ARGS="-Xms3g -Xmx3g -XX:MaxPermSize=512m" , Save and Exit the file.

Step 6: Restart puppet master service.

 command:  sudo systemctl restart puppet-master.service

Step 7: Allow port 8140/tcp from firewall.

 command:  sudo ufw allow 8140/tcp

Step 8: Enable puppet master to run in background.

 command:  sudo systemctl enable puppetserver

 

Now, Install Puppet Agent

The Puppet agent software must be installed on any server that the Puppet master will manage. In most cases, this will include every server in your infrastructure.

Step 1: To ensure every dependicies are installed and updated.

 command:  sudo apt-get update

Step 2: Get the puppet installation package from its repository using wget command.

 command:  wget https://apt.puppetlabs.com/puppet-release-bionic.deb

Step 3: Make the package ready for installation using dpkg command.

 command:  sudo dpkg -i puppet-release-bionic.deb

Step 4: Install the Puppet agent package.

 command:   sudo apt-get install puppet

Step 5: Start the agent and enable it to start on boot.

 command:   sudo systemctl start puppet

 command:  sudo systemctl enable puppet

Step 6: Edit hosts file in puppet Agent machine.

 command:   sudo nano /etc/hosts

Step 7: Edit hosts file in puppet master machine

 command:   sudo nano /etc/hosts

 

Configure puppet master

Step 1: we will sign the certificates on the Puppet master .

To show all available certificate to sign for connection

 command:   sudo puppet cert list

Step 2: To sign all the certificate sent to puppet master

 command:   sudo puppet cert sign –all


Create a Manifests on Puppet Server or Master

Step 1: Create a directory for manifests files.

 command:   sudo nano /etc/puppet/code/environments/production/manifests/site.pp

Step 2: Open site.pp with vim or nano editor. Add below code to site.pp

# execute 'apt-get update'
exec { 'apt-update':                    # exec resource named 'apt-update'
  command => '/usr/bin/apt-get update'  # command this resource will run
}
# install apache2 package
package { 'apache2':
  require => Exec['apt-update'],        # require 'apt-update' before installing
  ensure => installed,
}
# ensure apache2 service is running
service { 'apache2':
  ensure => running,
}
# install mysql-server package
package { 'mysql-server':
  require => Exec['apt-update'],        # require 'apt-update' before installing
  ensure => installed,
}
# ensure mysql service is running
service { 'mysql':
  ensure => running,
}

 

Step 3: Restart puppet-master service.

 command:   sudo systemctl restart puppet-master

 

On puppet agent machine

Step 1: Do an agent run.

 command:   sudo puppet agent –test

Step 2: Confirm installation of apache2

 command:   sudo service apache2 status




Comments ( 0 )

Please login to post a comment down here

CATEGORY

Technology

LIKES

0

VIEWS

1501

PUBLISHED

Dec. 8, 2023

Ad

author-image

Yeti

@yeti

  • 2.7K

    Views

  • 1.2K

    Followers


SIMILAR POSTS


Ad

How to install VMware on windows 10
Dec. 8, 2023

VMware Workstation Pro is a hosted hypervisor that runs on x64 versions of Windows and Linux operating systems. It enables users to set up virtual machines (VMs) on a single physical machine and use them simultaneously along with…


 6 min  0 comments