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://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
[root@pupnode1 ~]# yum install net-tools –y
[root@pupnode1 ~]# 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):

[main]
       logdir = /var/log/puppet
       runinterval = 10
       rundir = /var/run/puppet
       ssldir = $vardir/ssl
[agent]
       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):
[root@pupnode1 ~]# 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:

 [root@pupnode1 ~]# 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:

 root@pupnode7:~ # cd `whereis puppet | awk '{ print $2 }'`
 root@pupnode7:~ # make config
 puppet-port
 root@pupnode7:~ # make -DBATCH install

Add to startup:

 

root@pupnode7:~ # echo 'puppet_enable="YES"' >> /etc/rc.conf

Copy the configuration files:

root@pupnode7:~ # cd /usr/local/etc/puppet/
 root@pupnode7:~ # cp auth.conf-dist auth.conf
 root@pupnode7:~ # 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:

 root@pupnode7:~ # cd /usr/ports/security/ca_root_nss
 root@pupnode7:~ # make –DBATCH install

 

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

 root@pupnode7:~ # cd `whereis portupgrade | awk '{ print $2 }'`
 root@pupnode7:~ # make –DBATCH install
root@pupnode7:~ # cd `whereis portmaster | awk '{ print $2 }'`
 root@pupnode7:~ # make –DBATCH install

Check the connection:

 root@pupnode7:~ # puppet agent --server=pupmaster.unixmen.com --test --debug

Or:

 root@pupnode9:~ # 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:

 root@pupnode8:~ # /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:

 root@pupnode6:~# wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
 root@pupnode6:~# dpkg -i puppetlabs-release-trusty.deb
 root@pupnode6:~# apt-get update
 root@pupnode6:~# apt-get install puppet

 

Look to the version:

 root@pupnode6:~# puppet -V
 3.8.3

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):

 [main]
     logdir = /var/log/puppet
     runinterval = 10
     rundir = /var/run/puppet
     ssldir = $vardir/ssl
[agent]
         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=yes

Start puppet agent:

 root@pupnode6:~# service puppet start

Look at the agent fingerprint:

 root@pupnode6:~# 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

http://unixmen.com/puppet-installation-and-configuration-to-centos-7-x64/