How to Install Puppet Enterprise Server And Nodes

How to Install Puppet Enterprise Server And Nodes

In this tutorial I will show you how to install the Puppet Automation tool master and nodes.

Overview

It's good practice to have a Puppet master server which will be controlling the agents and yet agents/nodes will be pulling all info and configurations from there.

Requirements

Time should be accurately set and synced on Puppet master therefor will install the Network TIme Protocol.

yum install -y ntp

You must open firewall to port 8140 as this is the port which will be used from nodes too.

Install Puppet

 

Install Puppet repo. Below example is using el-7 "Which is for CENTOS and RedHAT 7".

rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm

Edit the /etc/yum.repos.d/puppetlabs.repo and change enabled from 0 to 1.

 

Install Puppet Master

 yum --enablerepo=puppetlabs-products,puppetlabs-deps -y install puppet-server

 

Edit Puppet Configuration

The main configuration resides in /etc/puppet/puppet.conf. Now you need to edit it and add the below

    dns_alt_names = YOUR-PUPPET-MASTER-HOSTNAME

 

Create the Key

Run below command and be sure to hit ctrl+c to break it after the key.

puppet master --verbose --no-daemonize

Above command will run the puppet but not in the background, this will let you create the key and just stop it after.

 

Start Puppet Master and Enable it

systemctl start puppetmaster
systemctl enable puppetmaster

 

Install Puppet Agent

 

yum -y install https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm

 

Enable the repo by changing all enabled=0 to enabled=1 and save the file. "/etc/yum.repos.d/puppetlabs.repo"

Installation

yum --enablerepo=puppetlabs-products,puppetlabs-deps -y install puppet

 

Configure Puppet Agent

Open /etc/puppet/puppet.conf and add the server to point it to the master server.

vi /etc/puppet/puppet.conf

in [agent]
server = your-puppet-master-servername

 

[agent]
# add follows into [agent] section : Puppet server's hostname or IP address
server = master_server_name

 

Change Puppet Agent Time Interval

Puppet agent by default check the master every 30 minutes, to change this you can simply edit /etc/puppet/puppet.conf and add the following to the [agent] section.

runinterval= 15m

This will change it to 15 minutes instead.

 

Testing Puppet Agent

puppet agent --test --ca_server=master-server-name

 

Start Puppet Agent Daemon and Enable it

systemctl start puppet
systemctl enable puppet

 

 

Sign Node from Puppet Master Server

Login to Puppet Master server and do the following:

List Certificates

puppet cert list

You will find the node name now run the following and change the host with your node name.

puppet cert --allow-dns-alt-names sign puppagent.us-west-2.compute.internal

List Nodes from Master

puppet cert list --all

Test Puppet Agent

puppet agent --test --noop

 

Testing Your First Puppet Manifest

 

From Puppet Master Server

 

vi /etc/puppet/manifests/site.pp
group { 'testgroup':
    ensure => present,
    gid    => 2000,
}

Above example will create testgroup in all nodes.

 


Subscribe to
for video tutorials updates