Intellipaat
Intellipaat

What is Puppet?

Puppet is one of the most used configuration management tools and is often used for server provisioning. It is one of the earliest configuration management tools that came into the DevOps world.

What is Puppet?
September 03, 2018      762 Views     0 Comment(s)

A system administrator’s bread and butter lies in successful configuration, deployment and maintenance of server machines. Often they are involved in doing repetitive tasks to accomplish this. Therefore they turn to scripting, automating those tasks. But this is easier said than done as scripting and automating have issues.

  • Custom made scripts aimed at solving a particular issue are not well documented
  • The update to these scripts is not that well defined
  • System administrators used to use scripting languages like Perl, Shell scripting, Python, Ruby, PHP and Go to automate repeated tasks.

If things grew linearly this arrangement would have worked well enough. But that’s when the Cloud happened and infrastructure growth happened massively. These scripts could not work well with such large infrastructures. So system administrators were in a fix as to how to do their daily chores. There was a dire need for a centralized configuration management(CM) tool through which any server or cluster of them could be configured remotely. That’s when Puppet happened.

Download latest questions asked on DevOps in top MNC's ?


But before we do venture into this Puppet tool let’s get a good grounding on what is configuration management.

Configuration management

It is a system of effecting the required changes to a system in order to ensure its integrity for a long time. Without relying on developers’ knowledge configuration management process ensures the determinism of the current system design and build state. As it records the system state effectively audit is easy to do. CM in effect overcame the following hurdles:

  • If a skewed new version of the component is employed somehow CM successfully reverts to a previous version of the component.
  • Determining as to which components have to be changed when requirements change
  • If the requirements have changed since the latest implementation CM effects redoing the implementation.

 

Puppet definition

It is a free management tool for centralizing and automating configuration management. Puppet is among the most used configuration management tools used in deploying, configuring and managing servers.

Puppet architecture

Puppet architecture

1. The puppet slave represents the facts which it sends to a Puppet Master. These facts are usually key/value data pair which gives out some aspects of Slave state like its uptime, operating system, IP address and various other things.

2. Puppet master uses the facts sent by the Puppet slave and constructs a catalog which is like a map as to how the slave should be configured. Said another way a catalog is simply a document which has the desired state for each resource which the Puppet Master manages on a slave.

3. Puppet slave conveys that the configuration is complete as per the catalog which can be seen in Puppet dashboard.

Suppose a user or group owns a file which Puppet manages then the file resource will auto require them. The unique power of Puppet software is that one can create their own resource types.

Wish to Learn DevOps? Click Here

Comparing Chef and Puppet

You’ll get to know the differences between Puppet and Chef through the 8 parameters as mentioned below.

PuppetChef
CompanyDeveloped by Puppet LabsOpscode
FriendlinessIt is more system friendlyIt is more program friendly
API integrationThere is no extended APIIt has an extended API
CommunityWide user baseRelatively small user base
Supported platformsWide range of operating systems support this tool. This feature was enhanced in 0.22.x – 0.25.x puppet versions. Puppet is also supported in Linux and Windows.Relatively small Oss support this tool
PricingPuppet has an open source version. For Puppet enterprise the first 10 nodes are free and after that it is charged at $99/node per yearThere is also a free version. For private chef for 20 servers – $120/month, for 100 servers – $600/month
Configuring the configuration serverRelatively DifficultRelatively easy
Prominent customersNokia and TwitterSplunk and Facebook

Key Puppet concepts

Let’s look at some of the important concepts in Puppet tool.

Modules

We have elucidated on the supported platforms in the Puppet tool. To do away the differences between various platforms Puppet modules are used. A good module should therefore give an API so that the software can be used on various platforms without having to know the details of the platform. One of the main advantages of reusable modules is that other people can easily understand it.

Classes

They are a collection of resources which are grouped together to get a target machine or machine in a desired state. They are defined inside Puppet manifest files which are found in Puppet modules.

Manifests

Manifests are those programs written in Ruby and saved with .pp extension. Generally speaking, all those Puppet programs are manifests which are built with the idea of creating and managing any target host machine.

If else command

Let’s see one instance where these conditional constructs can be seen in play.

Puppet Code:

If $variable == ‘text’

{   action1   }

Elseif $variable ==’txt’

action1

}

Steps to install Puppet

These are generic steps which are used to install Puppet in various platforms.
(1) Select a deployment type
(2) If standard agent/master architecture is chosen then one needs to decide as to what Puppet master and PuppetDB server will be.
(3) Check on OS versions and system requirements
(4) Inspect your network configuration
(5) Implement timekeeping on Puppet master server

Puppet use cases

In this puppet tutorial you’ll know in which instances Puppet really is used. Though these use cases you’ll know clearly how Puppet is very important in DevOps world. It is used to:

  • Give distinct configurations for every host. Also, continual rigorous checking is required to confirm whether the required configuration is in place and is unaltered.
  • Reduce the cost and effort when one has to change minor code in hundreds of systems.
  • Give a clear and auditable change control mechanism
  • Imbue new features and capabilities to existing systems effortlessly
  • Upgrade software packages throughout the enterprise
  • Garner firm grounding about the infrastructure and computing resources
  • Test desired changes in replica systems by automation. The automation capability by Puppet is high and that is why most DevOps engineers are opting for it.

 

How Puppet is trending?

Plethora of developer contribution – Huge number of developers add on to the source code of this tool.

Huge user base – Over 30,000 companies make use of this tool and even universities like Harvard and Stanford use this tool. Approximately 2 dozen new organizations employ this tool every day.

Good commercial usage – Since 2005 Puppet has been in commercial use and has been constantly improved from time to time. It has been successfully deployed in firms with very huge infrastructure with over 5000 machines.

Documentation–There are hundreds of pages of documentation for the language as well as the resource types. It’s frequently discussed in various forums. Therefore if anyone has any issues in Puppet tool then finding the answer is easy.

Platform support – Puppet server runs on any platform that hosts Ruby like Microsoft Windows Server, Oracle Enterprise Linux etc. Puppet can also run on various deployment models like public, private and hybrid clouds.

Conclusion

You ought to know that 2/3rd of Fortune 100 companies use Puppet. Puppet is a great tool to inspect, deliver, operate your software regardless of where it runs. One can enforce consistency across the entire infrastructure and also secure it. It can be updated as and when required and the systems will still be compliant with the new updates all due to the virtue of Puppet. Using a simple language one can design their apps and infrastructure. Those changes can easily be reflected across one’s data center and cloud platforms.

Deep dive into the world of DevOps through Intellipaat’s DevOps training!

 

Related Articles