Installation and Configuration of Puppet Master | DevOps | VisualPath

INSTALLING PUPPET
Prerequisites
Before we get started with installing Puppet, ensure that you have the following prerequisites:
• Private Network DNS: Forward and reverse DNS must be configured, and every server must have a unique hostname. If you do not have DNS configured, you must use your hosts file for name resolution.
• Firewall Open Ports: The Puppet master must be reachable on port 8140.
• Install NTP: Because it acts as a certificate authority for agent nodes, the puppet master server must maintain accurate system time to avoid potential problems when it issues agent certificates--certificates can appear to be expired if there are time discrepancies. We will use the Network Time Protocol (NTP) for this purpose.
Install it with the following apt command
sudo apt-get update &&sudo apt-get -y install ntp 
Install Puppet Master
Download the Puppet Labs package, with the following command
NOTE: For the time being we have taken centos
#yum install -y http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
Install the package
#yum install -y puppet-server 
After installing Puppet server, we can check the file structure as seen below

Install Puppet Agent:
#yum install -y http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm 
#yum install -y puppet   
Memory Allocation
By default, Puppet Server will be configured to use 2GB of RAM. However, if you want to experiment with Puppet Server on a VM, you can safely allocate as little as 512MB of memory. To change the Puppet Server memory allocation:
• Open /etc/sysconfig/puppetserver and modify these settings:
• # Modify this if you'd like to change the memory allocation, enable JMX, etc JAVA_ARGS="-Xms2g -Xmx2g"
• Replace 2g with the amount of memory you want to allocate to Puppet Server. For example, to allocate 1GB of memory, use JAVA_ARGS="-Xms1g -Xmx1g"; for 512MB, use JAVA_ARGS="-Xms512m -Xmx512m".
• For more information about the recommended settings for the JVM, please see Oracle’s docs on JVM tuning.
• Restart the puppetserver service after making any changes to this file. 

Configure Puppet Master

The main configuration file for Puppet is etc/puppet/puppet.conf. All Puppet related settings such as the definition of Puppet master, Puppet agent, Puppet apply and certificates are defined in this file. Puppet configuration file mainly consists of the following config sections. 
Main: This is known as the global section which is used by all the commands and services in Puppet. One defines the default values in the main section which can be overridden by any section present in puppet.conf file.
Master: This section is referred by Puppet master service and Puppet cert command.
Agent: This section is referred by Puppet agent service.
User: It is mostly used by Puppet apply command as well as many of the less common commands.
Following are the sample examples for config sections on both puppet master and agents
Example agent config
[main]
certname = agent01.example.com
server = puppet
environment = production
runinterval = 1h 

Example master config
[main]
certname = puppetmaster01.example.com
server = puppet
environment = production
runinterval = 1h
strict_variables = true 

[master]
dns_alt_names = puppetmaster01,puppetmaster01.example.com,puppet,puppet.example.com
reports = puppetdb
storeconfigs_backend = puppetdb
storeconfigs = true
environment_timeout = unlimited 
The basic changes to be made on puppet master configuration file 
vi /etc/puppet/puppet.conf
[main]
certname = puppetmaster   
The basic changes to be made on puppet agent configuration file 
vi /etc/puppet/puppet.conf
[agent]
server = puppetmaster   
The above commands update the puppet master and agent info in the configuration.
For DevOps training contact us at +91 9704455959 / info@visualpath.in
For more information about Visualpath, visit www.visualpath.in and follow the company on Facebook and Twitter.

Comments