<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">
Go to top icon

Puppet for beginners installation and configuration in Ubuntu 14.04

Rohidas Bagul Jan 06, 2017

Puppet

Introduction

Puppet is configuration management tool. Puppet manages configuration data on these systems, including users, packages, processes, services. Puppet can manage complex components to ensure compliance with policies you write. Puppet can ensure configuration consistency across thousands of servers. Puppet utilizes node-specific data to tune the policy correct for each system.

As an administrator, you will utilize Puppet configuration language to declare final state of your systems. We describe Puppet as “declarative”.

Declarative language is much easier to read, Puppet was designed to achieve consistent and repeatableresults. Every time Puppet evaluates state of node, it will bring node to a state consistent with the configuration policy.

How Puppet works?

On any node you control is an application namePuppetagent. The agent evaluatesand implements Puppet manifests and files containing Puppet configuration language that declare, desired state of node. The agent evaluates state of each component described in a manifest,and not any change is necessary. If the component needs to be changed, the agent makes the requested changes and logs the event. Puppet will send the node’s data to the master, and receive back a pre-compiled catalogcontaining only the node’s specific policy to enforce. Puppet provides many different ways classify and categorize nodes to limit which resources should be applied to which nodes.

Importance of Puppet

  • Puppet provides a well-designed infrastructure for managing state of many nodes simultaneously.
  • Facter provides Puppet with local data to customize the policy for each specific node. The values specific to the node including hostname, operating system, memory, networking configuration and many node-specific details.
  • Write a singlemanifest which will work on different operating systems.
  • Puppet agent can be invoked with specific tags, allowing a filtered run which is the only perform operations that matchesthe tags during a given invocation.
  • Puppet agents report back success, failure, and specific return codes for each run.
  • Puppet uses a decentralized approach were each node evaluates and executes their own Puppet catalog separately.
  • Orchestration systems such as the Marionette Collective (MCollective) can invoke and control the Puppet agent.

Puppet System & Hardware Requirement

  • Puppet master server
    Processor: 2 cores minimum
    RAM: 1GB minimum
    Recommended – RAM: 2GB used get well perform
    Puppet agent has no particular hardware requirement.
  • Operating system
    AIX, Microsoft windows Server, OS X
    Oracle Enterprise Linux, Red Hat Enterprise Linux
    Scientific Linux, Solaris, Suse Linux Enterprise Server
    Ubuntu, Centos.

Install Puppet Master

We will be working with an Ubuntu 14.04 LTS master server and one agent nodes: on Ubuntu 14.04.

  • Install the puppetmaster-passenger package:

    sudo apt-get install puppetmaster-passenger

  • Ensure you have the latest version of Puppet by running:

    sudo puppet resource package puppetmaster ensure=latest

Configure Puppet Master

  • Update /etc/puppet/puppet.conf and add the dns_alt_names line to the section [main], replacing puppet.master.com with your own FQDN name:

    /etc/puppet/puppet.conf
    [Main]
    Dns_alt_names = puppet, puppet.master.com

  • Remove the line templatedir=$confdir/templates, Start the puppet master:

    sudo service puppetmaster start

Install Puppet Agent

Configure Puppet Agent

  • Add the server value to the [main] section of the nodes puppet.conf file, replacing puppet.master.com with the FQDN of your Puppet master:

    /etc/puppet/puppet.conf
    [main]
    Server = puppet.master.com

  • Restart the Puppet service:

    sudo service puppet restart

Generate and Sign Certificates

    • Generate a certificate for Puppet master to sign:
    • Agent machine:

      sudo puppet agent -t

It will output an error, stating that no certificate has been found. Because the generated certificate needs to be approved by the Puppet master.

On Puppet master list the certifications that need approval:

It should output display with your agent nodes hostname.

Puppet master Machine:

sudo puppet cert list --all

Approve the certificate, replacing hostname:

sudo puppet cert sign hostname.example.com

On the Puppet agent node runs the Puppet agent again:

sudo puppet agent –t

Successfully run without error.

Reference Links: https://docs.puppet.com/puppet/

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.