Friday, October 24, 2014

Introduction to Puppet

What is puppet?
Puppet is an open-source IT automation tool [1].
"The Puppet Domain Specific Language (DSL) is a Ruby-based coding language that provides a precise and adaptable way to describe a desired state for each machine in your infrastructure. Once you've described a desired state, Puppet does the work to bring your systems in line and keeping them there" - Puppet Labs

Why not write a simple shell script instead of using puppet?
For small number of nodes and simple shell commands, writing shell scripts may appear appealing.
But what if you are having large number of nodes/machines or having different operating systems?
How you are going to manage all of your large number of scripts?

This is where Puppet comes in to play.
Puppet allows you to define details of a configuration in a way that takes off the burden of operating system specifics.
It lets you easily maintain, audit and understand your whole IT infrastructure than having large number of complicated shell scripts.

How to check puppet version?
>puppet -V
Note that it must be the capital letter 'V'.

You will get a response as below if you have installed puppet in your system.
>3.6.2 (Puppet Enterprise 3.3.2)

Puppet not installed?

Manually install and configure puppet master and agent
Read this blog article: Installing and configuring puppet master and agent

Lazy to install puppet?
How about a preconfigured VM image to learn puppet :)
Given that you have VMware or Oracle VirtualBox installed on your system,
you can follow the link [1] and download a preconfigured VM to follow the puppet tutorial from puppet labs.

When you are trying to install master-agent you may get puppet master-agent communication errors.
See this blog article which may help to solve your common problems: Puppet master-agent communication errors

Want to go further with puppet?
See this blog article on how to create files from templates and change its content on the go: Puppet how to create a file and change its content using templates

Reference:
[1] http://puppetlabs.com/download-learning-vm