In this post, we will try to understand basic terminology used in Puppet which will help us understand Puppet


  • PUPPET MASTER


This is our Puppet server which takes care of puppet clients which connect to it. It serves required data to clients and gets reports from clients once our configurations are done on them. This acts as a centralized machine for all your Puppet activity by default.


  • MASTERLESS PUPPET

Puppet configuration management tool can be deployed in two ways. One is Client-server model and the other is an independent node model or a masterless setup. Depends on your requirement we can use one of these models. Many people may have a question how is it possible to configure Masterless-puppet. For those people, “puppet apply /path/to/my/site.pp” command is the answer. We can apply puppet catalogs if we have puppet manifests locally available using puppet apply command. We will see more about this command in future.


  • PUPPETMASTERD

Running state of Puppet server is called as puppetmasterd


  • PUPPET AGENT

Running state of Puppet client software. This software is useful for

1)  Gathering facts: Getting vast system details like OS type, version, RAM details, CPU details and much  more using installed facter tool.

2)  Send those details to master for getting required compiled configuration details(catalogs)

3) Getting compiled configuration details from puppet master

4) Executing those compiled configurations at a designated time.

5) Collecting and sending reports of this expected configuration on the client.


  • PUPPET NODE

Puppet clients are called as nodes.


  • RESOURCES

These are files/configs which can be used for changing settings at nodes.


  • FACTER

Reporting tool at nodes, which reports about OS/HW/SW types etc to puppet master about the node where it is installed.


  • CLIPPED OUTPUT OF FACTER COMMAND:

architecture => amd64
blockdevices => sda,sdb
boardmanufacturer => Hewlett-Packard
fqdn => linuxnix
gid => root
hardwareisa => x86_64
hostname => linuxnix
id => root
interfaces => eth0,lo,virbr0,virbr0_nic,wlan0
ipaddress => 192.168.122.1
kernel => Linux
kernelmajversion => 4.4
kernelrelease => 4.4.0-31-generic
kernelversion => 4.4.0
memoryfree => 2.41 GB
memorysize => 7.58 GB
memorysize_mb => 7757.53


  • ATTRIBUTE

Attributes are used to specify the state desired for a given configuration resource. We will see more about this in our coming posts.


  • PUPPET MANIFESTS

A file containing code written in the Puppet DSL language, and named with the .pp file extension. All manifests are stored in /etc/puppet/manifests or /etc/puppet/modules//manifests.


  • CATALOGS

Compiled form of manifests.


  • PUPPET MODULES

Modules are a bigger form of manifests. Every manifest in a module should define a single class or defined type.


  • FILES

Physical files you can serve out to your agents through puppet. These are stored in /etc/puppet/files or /etc/puppet/modules//files.


  • TEMPLATES

Template files contain puppet code with variables which can populate variable values depending on node details.


  • CLASSES

Collections of resources


  • DEFINITIONS

Composite collections of resources


Puppet is a Configuration Management tool that is used for deploying, configuring and managing servers. It performs the following functions:
  • Defining distinct configurations for each and every host, and continuously checking and confirming whether the required configuration is in place and is not altered (if altered Puppet will revert back to the required configuration) on the host.
  • Dynamic scaling-up and scaling-down of machines.
  • Providing control over all your configured machines, so a centralized (master-server or repo-based) change gets propagated to all, automatically.
Puppet uses a Master Slave architecture in which the Master and Slave communicate through a secure encrypted channel with the help of SSL

Configuration Management

System Administrators usually perform repetitive tasks such as installing servers, configuring those servers, etc. They can automate this task, by writing scripts, but it is a very hectic job when you are working on a large infrastructure.
To solve this problem, Configuration Management was introduced. Configuration Management is the practice of handling changes systematically so that a system maintains its integrity over time. Configuration Management (CM) ensures that the current design and build state of the system is known, good & trusted; and doesn’t rely on the tacit knowledge of the development team. It allows access to an accurate historical record of system state for project management and audit purposes. Configuration Management overcame the following challenges:
  • Figuring out which components to change when requirements change.
  • Redoing an implementation because the requirements have changed since the last implementation.
  • Reverting to a previous version of the component if you have replaced with a new but flawed version.
  • Replacing the wrong component because you couldn’t accurately determine which component needed replacing                                                         
 WHY WE NEED CONFIGURATION MANAGEMENT TOOLS?

  • As a system administrator our job is a tedious one with repetitive tasks. As infrastructure grows these tedious tasks will take a big chunk of our time. This is where automation comes in to picture. Many people started using scripting languages like Shell scripting, Perl scripting, Python scripting, Ruby, PHP or even new language Go to automate repeated tasks. But our infrastructure growth did not stopped to just couple of 100 machines and growing exponentially with the advent of Cloud. This is where we require centralized configuration management tools like Puppet and Ansible. These tools allows us to configure any server or even multiple servers remotly and with ease. This is a kind of big brother to fabric module in Python. Below are some advantages.
  • Saves the time,
  • Repetitive task removal at a large scale.
  • Can work in homogeneous environments.
  • With puppet like tools we can build entire infrastructure without manual intervention in hours time which normally takes weeks or even months to set-up with huge financial inputs.

  • WHAT ARE DISADVANTAGES OF SCRIPTING?
    • A scripting language can be used to automate simple to medium tasks but if you want to build complete infrastructure we have to take help from configuration management tools which can talk to different parts of an infrastructure. As these tools implemented different modules to talk to different parts of IT infra structure.

  • WHY WE REQUIRE PUPPET?
    • Though cfengine is the first configuration tool it did not capture market. Puppet did that and most companies uses it now. But from my experience puppet is good for devops and Ansible is good for system administrators.

  • WHO DEVELOPED PUPPET?
    • Luke Kanies is a system admin who thought scripting is limiting factor to automate system admin tasks and developed puppet as an open source project.

  • WHOM PUPPET IS MEANT FOR?
    • Puppet is meant for all the people who like to automate infrastructure tasks(devops) or orchestration tasks(sysops).

  • WHERE WE CAN/CAN NOT USE PUPPET?
    • Ok, is puppet/Ansible only solution for system administration? The answer is no. There are still some tasks which we have to depend on manual system administration or scripting.