Installing open-source standalone Puppet on CentOS 7

Puppet is an open-source configuration management tool – for infrastructure orchestration, or automated provisioning, or configuration automation, and lot more. The simplest use case is for automated provisioning i.e. the tasks we need to perform once our machine/VM comes up for the first time (or even after it), like installing webserver, DB server, etc. Instead of manually performing the tasks/running the tasks we can use any of the available configuration management tools (like Puppet) to automate the boring repetitive tasks, and also making configuration consistent across all the servers.

Just to give you an idea (going into detail is out of scope – I’ll cover it later) – Puppet can be setup in 2 different modes, as per requirement:
  • Standalone setup

    where each machine/node has puppet software installed and running. Each node also has it’s copy of puppet configuration (puppet manifests),  which you can run using puppet apply on the node.

  • Agent-Master setup

    For this the distributed puppet package is used i.e. the nodes you need to manage run the puppet-agent software,  as a background service. and the management node (puppet server/master node)has the puppet server software installed. Puppet master pushes the configurations to managed nodes i.e. Puppet agents, and Puppet agents periodically send facts back to Puppet master.

Puppet is written in Ruby programming language, and it is available for Linux, Mac, BSD, Solaris and Windows-based computer Systems.
Puppet (previously Puppet Labs), the company behind the development and distribution of Puppet software, ships Puppet as an open-source software released under Apache License, and separately as an enterprise release i.e. Puppet Enterprise. For this tutorial we’ll be installing the standalone open-source Puppet.

Installation

Check if Puppet is already installed
[vagrant@localhost ~]$ which puppet
/usr/bin/which: no puppet in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin)
Installing standalone Puppet is as simple as running yum install – for you the newbies yum is basically the package manager for CentOS i.e. it is the command/utility to install or remove packages. yum looks for the asked packages in available package repositories. For installing Puppet first thing we need to do is adding the Puppet’s repo.
(If you have CentOS 6, change the le-7 to el-6 —- use sudo if you’re not root).

Adding the Puppet’s repo
# rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
The exact output:
$ sudo rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
Retrieving http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
warning: /var/tmp/rpm-tmp.3dEsUA: Header V4 RSA/SHA512 Signature, key ID 4bd6ec30: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
1:puppetlabs-release-22.0-2        ################################# [100%]
You can verify, if the Puppet repo has been added successfully, using the yum repolist:
# yum repolist | grep puppet
The exact output:
$ yum repolist | grep puppet
puppetlabs-deps/x86_64         Puppet Labs Dependencies El 7 - x86_64        17
puppetlabs-products/x86_64     Puppet Labs Products El 7 - x86_64           225

Installing Puppet
Now execute the yum install command and you’ll be done. The ‘yes‘ on the right side is for the set of question you’ll be asked during installation:
# yes | yum -y install puppet
The exact output:
[vagrant@localhost ~]$ yes | sudo yum -y install puppet
Loaded plugins: fastestmirror
http://centosmirror.go4hosting.in/7.2.1511/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to centosmirror.go4hosting.in:80; Connection refused"
Trying other mirror.
base                                                     | 3.6 kB     00:00
extras                                                   | 3.4 kB     00:00
puppetlabs-deps                                          | 2.5 kB     00:00
puppetlabs-products                                      | 2.5 kB     00:00
updates                                                  | 3.4 kB     00:00
(1/2): puppetlabs-deps/x86_64/primary_db                   | 8.4 kB   00:01
(2/2): puppetlabs-products/x86_64/primary_db               |  69 kB   00:02
Loading mirror speeds from cached hostfile
* base: mirrors.nayatel.com
* extras: mirrors.nayatel.com
* updates: mirrors.nayatel.com
Resolving Dependencies
--> Running transaction check
.................................................</div>
<div>................................................
--> Finished Dependency ResolutionDependencies Resolved
..........................
..........................
Installed:
puppet.noarch 0:3.8.7-1.el7Dependency Installed:
augeas-libs.x86_64 0:1.4.0-2.el7       facter.x86_64 1:2.4.6-1.el7                  hiera.noarch 0:1.3.4-1.el7                   libselinux-ruby.x86_64 0:2.2.2-6.el7   libyaml.x86_64 0:0.1.4-11.el7_0
pciutils.x86_64 0:3.2.1-4.el7          ruby.x86_64 0:2.0.0.598-25.el7_1             ruby-augeas.x86_64 0:0.4.1-3.el7             ruby-irb.noarch 0:2.0.0.598-25.el7_1   ruby-libs.x86_64 0:2.0.0.598-25.el7_1
ruby-shadow.x86_64 1:2.2.0-2.el7       rubygem-bigdecimal.x86_64 0:1.2.0-25.el7_1   rubygem-io-console.x86_64 0:0.4.2-25.el7_1   rubygem-json.x86_64 0:1.7.7-25.el7_1   rubygem-psych.x86_64 0:2.0.0-25.el7_1
rubygem-rdoc.noarch 0:4.0.0-25.el7_1   rubygems.noarch 0:2.0.14-25.el7_1Complete!

Verify puppet installation and version:
[vagrant@localhost ~]$ which puppet
/usr/bin/puppet
[vagrant@localhost ~]$ puppet --version
3.8.7

Leave a Reply

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