Installing Puppet Master and Agent in RHEL/CentOS 7/6/5

Since the computer and computation came into existence the focus remained on automating the task at certain level. Automating task refers to completion of task mostly with itself with least or no human intervention. Most of the fields of engineering be it networking, aircraft, etc. implemented work automation in some form. Task Automation aims at saving Man power, Cost, Time, Energy and accomplish task with accuracy.

Automation at Server level is critical and automating task at server side is one of the most important task for every System Administrator. There are lots of wonderful tools available for System automation, but one tool which always comes to my mind is called Puppet.

Install Puppet in CentOS

Install Puppet in CentOS

What is Puppet?

Puppet is a Free and Open Source software released under Apache License and developed by Puppet Labs for GNU/Linux, Mac, BSD, Solaris and Windows based computer Systems. The project is written in ‘Ruby’ programming Language and it is mostly used at server automation for expressing system configuration as well as a client and server for distributing it, and a library for realizing the configuration.

The latest open source (community maintained) Puppet version <=2.7.26 was released under GNU General Public License.

Puppet Project Aims

Puppet Project Aims at having an expressive enough language supported by a powerful library. It Provide interface to write custom server automation applications in just a few lines of code. Puppet has rich extensibility feature with added functionality support as and when required. Last but not the least it lets you share your work with the world as simple as sharing codes.

Features of Puppet

  1. Designed in such a way that it prevents duplication for everyone solving the same problem.
  2. Mature Tool
  3. Powerful Framework
  4. Simplify System Administrator’s Technical Task.
  5. System Administrator’s task is written in Puppet’s Native code and can be shared.
  6. Makes it possible to make rapid and repeatable changes automatically.
  7. Maintains System Consistency and Integrity.
  8. Helpful in managing Physical and Virtual devices as well as cloud.

This article covers only installation of open source release of Pupper Server and Puppet Agent on RHEL/CentOS 7/6/5.

Step 1: Enable Dependencies and Puppet Labs Repository On Master

1. The server acting as a puppet master should have its system time set accurately. To set, accurate system time you should probably use NTP service. For more instructions on how to set correct system time with NTP, follow the below article.

  1. Set System Time with “NTP (Network Time Protocol)” in RHEL/CentOS

2. Once system time is set correctly, you should enable “optional” channel on RHEL distributions only, to install Puppet. For more instructions on how to enable “optional” channel on RHEL systems can be found Here.

3. Once channel is enabled, you can install latest versions of Puppet using Puppet Labs package repository on your correspondent RHEL/CentOS versions.

RHEL/CentOS 7
# rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
RHEL/CentOS 6
# rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
RHEL/CentOS 5
# rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-5.noarch.rpm

Step 2: Installing and Upgrading Puppet on the Master Server

4. On your master server, run the following command to install Pupper Server, it will install an init script (/etc/init.d/puppetmaster) for executing a test-quality puppet master server.

Do not start puppet master service now.

# yum install puppet-server

5. Next, run the following command to upgrade Puppet to most newest version.

# puppet resource package puppet-server ensure=latest

6. Once upgrade process completes, you will need to restart the puppet master web server to reflect new changes.

# /etc/init.d/puppetmaster restart

Step 3: Installing and Upgrading Puppet on Agent Node

7. Login to your agent node server and run the following command to install Puppet agent. Once you install Puppet agent, you may notice that an init script (/etc/init.d/puppet) has been generated for running the puppet agent daemon.

Do not start puppet agent service now.

# yum install puppet

8. Now upgrade the installed puppet agent to the most recent versions, with the help of following command.

# puppet resource package puppet ensure=latest

9. Once upgrade completes, you will need to restart the puppet service to take new changes.

# /etc/init.d/puppet restart

That’s it! at this moment, your Puppet server and Agent installed successfully, but it isn’t configured properly, to do so you need to follow the post-install and configuration tasks at.

Puppet: Post-Install Tasks and Configuration

Conclusion

Puppet automation tool seems robust, user friendly interface, as well as very declarative. Installation was very easy for me it was nothing to worry about dependencies at installation.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

17 Responses

  1. Salman says:

    I am getting below error while generating certificate in one of our server. So how to resolve this issue?

    [[email protected] bin]# puppet agent --test1 --ca_server=master.yumserver_rhel7
    /opt/puppetlabs/puppet/bin/ruby: /lib64/libcrypt.so.1: version `XCRYPT_2.0' not found (required by /opt/puppetlabs/puppet/lib/libruby.so.2.4)
    /opt/puppetlabs/puppet/bin/ruby: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /opt/puppetlabs/puppet/lib/libruby.so.2.4)
    /opt/puppetlabs/puppet/bin/ruby: /lib64/libcrypt.so.1: version `XCRYPT_2.0' not found (required by /opt/puppetlabs/puppet/lib/libruby.so.2.4)
    /opt/puppetlabs/puppet/bin/ruby: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /opt/puppetlabs/puppet/lib/libruby.so.2.4)

  2. Bob Forehead says:

    Puppetmaster has been renamed to puppetserver to prevent twitter outrage mobs from attacking Puppetlabs. Slavery was invented by wypipo or something.

  3. satya says:

    i installed downloaded and installed puppet rpm , but unable to open conf file for the same

    [[email protected]]# rpm -qa | grep pup
    puppetlabs-release-6-12.noarch
    [[email protected]]# /etc/init.d/puppetmaster status
    -bash: /etc/init.d/puppetmaster: No such file or directory
    [[email protected]]#

  4. Mahesh says:

    Hi Avishek,

    Can we install both master and agent on one machine? If so, can we just follow the above steps to do that?

    Thanks

  5. Sergio Mira says:

    Very thanks!

    Just an alert:
    If you are running a centos 7, there is no script in /etc/init.d, because of systemd.
    Then you need to control it via systemctl, as follows:

    To verify service status:
    systemctl status puppetmaster

    To restart service:
    systemctl restart puppetmaster

    To enable service to start on boot:
    systemctl enable puppetmaster

  6. Alan says:

    Step #1 has a substep #2. The hyperlink in this step is broken.

    This link returns “404 Not Found.”

    https://access.redhat.com/documentation/en-US/OpenShift_Enterprise/1/html/Client_Tools_Installation_Guide/Installing_Using_the_Red_Hat_Enterprise_Linux_Optional_Channel.html

    How do I install the Optional Channel?

  7. I wrote puppetinstall (bash script) sometime back : https://github.com/thilinapiy/puppetinstall It will install puppet (master/agent) on RHEL 6 but not in RHEL 7. Give a try if you can and also a pull request for RHEL7 too.

    • Ravi Saive says:

      Dear Thilina,

      Thanks for creating easy bash script to install puppet, will surely give it a try on RHEL/CentOS 7, will update you..

  8. Nagu says:

    Hi Kumar,

    Everybody knows how to install rpm’s. We need articles on how to maintain 50 production servers with puppet. How to make one single configuration in 50 servers change from one single click on master.

    Thanks,

    • Avishek Kumar says:

      Dear Nagu,
      me too believes the same.
      Anyway, its now the admin’s responsibility what they want to include and exclude in the future article.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.