Puppet agent install and configure to all Linux/UNIX

Please considerate the installation article of Master puppet  in the  article before  from this  LINK  :  http://www.unixmen.com/puppet-installation-and-configuration-to-centos-7-x64/

The  articles  are related to understand how puppet works

Install puppet agent to the CentOS7 x64 server
After steps for CentOS nodes in the CentOS PuppetManager.docx artcile we must install puppet agent:

First  : rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
[[email protected] ~]# yum install net-tools –y
[[email protected] ~]# yum install -y puppet

The content of the /etc/puppet/puppet.conf file will be as following (Be careful, you must set node certificate name in the certname and server in the server directive):

       logdir = /var/log/puppet
       runinterval = 10
       rundir = /var/run/puppet
       ssldir = $vardir/ssl
       classfile = $vardir/classes.txt
       localconfig = $vardir/localconfig
       server = pupmaster.unixmen.com  
       certname = pupnode1.unixmen.com


Check the server connection(The following command will help us for troubleshooting and for that before start the daemon, use this command):
[[email protected] ~]# puppet agent –server=pupmaster.unixmen.com –test –debug

If command will successfully will created file with /tmp/hello-file name.

Remove certificates
When server removes already signed certificate for agent, we must remove certificates from agent as follows:

 [[email protected] ~]# rm -rf /var/lib/puppet/ssl/*


Install puppet agent to the FreeBSD 10.1 x64 server
After steps for FreeBSD nodes in the CentOS PuppetManager.docx artcile we must install puppet agent. We will install agent from the ports:

 [email protected]:~ # cd `whereis puppet | awk '{ print $2 }'`
 [email protected]:~ # make config
 [email protected]:~ # make -DBATCH install

Add to startup:


[email protected]:~ # echo 'puppet_enable="YES"' >> /etc/rc.conf

Copy the configuration files:

[email protected]:~ # cd /usr/local/etc/puppet/
 [email protected]:~ # cp auth.conf-dist auth.conf
 [email protected]:~ # cp puppet.conf-dist puppet.conf


You can download the content of the /usr/local/etc/puppet/puppet.conf file from this link.

We must add runinterval = 10 line in the [agent] topic, remove [main] topic and change hostname directives as you server hostname (This means change every place where pupnode7 to yours).

Puppet require know about root CA’s and for that we will install ca_root_nss from the ports:

 [email protected]:~ # cd /usr/ports/security/ca_root_nss
 [email protected]:~ # make –DBATCH install


Manifests as install provider uses portupgrade and portmaster. We must install them:

 [email protected]:~ # cd `whereis portupgrade | awk '{ print $2 }'`
 [email protected]:~ # make –DBATCH install
[email protected]:~ # cd `whereis portmaster | awk '{ print $2 }'`
 [email protected]:~ # make –DBATCH install

Check the connection:

 [email protected]:~ # puppet agent --server=pupmaster.unixmen.com --test --debug


 [email protected]:~ # puppet agent --test


Note: Be careful, in manifests must not be anything blocks configuration your server. Else will be “Error: Could not retrieve catalog from remote server: Error 400 on SERVER:” error.

Start the daemon:

 [email protected]:~ # /usr/local/etc/rc.d/puppet start

Install puppet agent to Ubuntu 14.04 x64 server
After steps for Ubuntu nodes in the CentOS PuppetManager.docx artcile we must install puppet agent. In default ubuntu repositories puppet version is very old and for that we will add the puppet repositories from the puppet official site:

 [email protected]:~# wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
 [email protected]:~# dpkg -i puppetlabs-release-trusty.deb
 [email protected]:~# apt-get update
 [email protected]:~# apt-get install puppet


Look to the version:

 [email protected]:~# puppet -V

Our puppet version is 3.8.3. For automatically update this version add the following lines to the /etc/apt/preferences.d/00-puppet.pref file:
# /etc/apt/preferences.d/00-puppet.pref
Package: puppet puppet-common puppetmaster-passenger
Pin: version 3.8*
Pin-Priority: 501

Change the /etc/puppet/puppet.conf configuration file as follows(As you see server directive define the master server and certname directive define ubuntu agent common name):

     logdir = /var/log/puppet
     runinterval = 10
     rundir = /var/run/puppet
     ssldir = $vardir/ssl
         classfile = $vardir/classes.txt
         localconfig = $vardir/localconfig
         server = pupmaster.unixmen.com
         certname = pupnode6.unixmen.com


Change the following line in the /etc/default/puppet file as following. This will start the puppet automatically after system reboot:

Start puppet agent:

 [email protected]:~# service puppet start

Look at the agent fingerprint:

 [email protected]:~# puppet agent --fingerprint
 (SHA256) F0:43:70:C6:9C:99:43:8F:46:50:37:DD:C1:51:B4:55:1F:FE:73:D1:0C:3B:FD:1D:C0:AD:E4:D3:38:3D:9B:FA

Install  Puppet  Master