Difference between revisions of "HowTo/InstallPuppetClient"

From LunaSys
Jump to navigation Jump to search
(Created page with "== Puppet Client Installation and Configuration == === On the server - Preparation === - Add the iptables rules to allow port 8140 for the new client: Example (you need to ...")
 
Line 20: Line 20:
 
- (Optional: only if latest release required) Add the puppet repo:
 
- (Optional: only if latest release required) Add the puppet repo:
  
  vim /etc/yum.repos.d/puppet.repo=
+
  vim /etc/yum.repos.d/puppet.repo
 
<verbatim>
 
<verbatim>
 
[puppetlabs]
 
[puppetlabs]
Line 40: Line 40:
 
</verbatim>
 
</verbatim>
  
- Make sure the hostname is fully qualified, eg 'antares3.winsoft-international.com' and not just 'antares3'
+
- Make sure the hostname is fully qualified, eg 'yuka.lunasys.fr' and not just 'yuka'
  
- Edit configuration file =/etc/puppet/puppet.conf= to have:
+
- Edit configuration file /etc/puppet/puppet.conf to have:
  
 
<verbatim>
 
<verbatim>
Line 53: Line 53:
 
     classfile = $vardir/classes.txt
 
     classfile = $vardir/classes.txt
 
     localconfig = $vardir/localconfig
 
     localconfig = $vardir/localconfig
     server = puppet.winsoft.fr
+
     server = puppet.lunasys.fr
 
     report = true
 
     report = true
 
     pluginsync = true
 
     pluginsync = true
Line 61: Line 61:
  
 
<verbatim>
 
<verbatim>
puppetd --waitforcert 30 --server puppet.winsoft.fr -v
+
puppetd --waitforcert 30 --server puppet.lunasys.fr -v
 
</verbatim>
 
</verbatim>
  
Line 86: Line 86:
 
     classfile = $vardir/classes.txt
 
     classfile = $vardir/classes.txt
 
     localconfig = $vardir/localconfig
 
     localconfig = $vardir/localconfig
     server = puppet.winsoft.fr
+
     server = puppet.lunasys.fr
 
     report = true
 
     report = true
 
     pluginsync = true
 
     pluginsync = true
Line 94: Line 94:
  
 
<verbatim>
 
<verbatim>
puppetd --waitforcert 30 --server puppet.winsoft.fr -v
+
puppetd --waitforcert 30 --server puppet.lunasys.fr -v
 
</verbatim>
 
</verbatim>
  
Line 122: Line 122:
 
==== /var/log/messages ====
 
==== /var/log/messages ====
  
- If you get 'Could not request certificate: getaddrinfo: Name or service not known', you may need to add the following line in =/etc/puppet/puppet.conf= under the '[agent]' section:
+
- If you get 'Could not request certificate: getaddrinfo: Name or service not known', you may need to add the following line in /etc/puppet/puppet.conf under the '[agent]' section:
 
<verbatim>
 
<verbatim>
 
server = puppet.winsoft.fr
 
server = puppet.winsoft.fr

Revision as of 16:27, 16 October 2012

Puppet Client Installation and Configuration

On the server - Preparation

- Add the iptables rules to allow port 8140 for the new client:

Example (you need to change IP and insert position): <verbatim> iptables -I INPUT 8 -s 188.165.38.75 -m tcp -p tcp --dport 8140 -j ACCEPT </verbatim>

Client side

CentOS / RHEL

In this doc, we assume the master is located at puppet.winsoft-international.com

- [[Public.EPEL][Add EPEL]]

- (Optional: only if latest release required) Add the puppet repo:

vim /etc/yum.repos.d/puppet.repo

<verbatim> [puppetlabs] name=Puppet Labs Packages baseurl=http://yum.puppetlabs.com/el/6/products/x86_64/ enabled=1 gpgcheck=0 [puppetlabs2] name=Puppet Labs Packages Deps baseurl=http://yum.puppetlabs.com/el/6/dependencies/x86_64/ enabled=1 gpgcheck=0 </verbatim>

- Install puppet <verbatim> yum install -y puppet chkconfig puppet on </verbatim>

- Make sure the hostname is fully qualified, eg 'yuka.lunasys.fr' and not just 'yuka'

- Edit configuration file /etc/puppet/puppet.conf to have:

<verbatim> [main]

   logdir = /var/log/puppet
   rundir = /var/run/puppet
   ssldir = $vardir/ssl

[agent]

   classfile = $vardir/classes.txt
   localconfig = $vardir/localconfig
   server = puppet.lunasys.fr
   report = true
   pluginsync = true

</verbatim>

- Register with the master

<verbatim> puppetd --waitforcert 30 --server puppet.lunasys.fr -v </verbatim>

Debian

- Install puppet

<verbatim> apt-get install puppet </verbatim>

- Edit configuration file =/etc/puppet/puppet.conf= to have:

<verbatim> [main]

   logdir = /var/log/puppet
   rundir = /var/run/puppet
   vardir = /var/lib/puppet
   ssldir = $vardir/ssl
   factpath = $vardir/lib/facter
   templatedir = $confdir/templates

[agent]

   classfile = $vardir/classes.txt
   localconfig = $vardir/localconfig
   server = puppet.lunasys.fr
   report = true
   pluginsync = true

</verbatim>

- Register with the master

<verbatim> puppetd --waitforcert 30 --server puppet.lunasys.fr -v </verbatim>

On the server - Finalization

- Allow the new client:

First, list requests: <verbatim> puppetca -l </verbatim>

Select the hostname of the wanted server and allow it: <verbatim> puppetca -s <hostname> </verbatim>

You're done. The client is registered and will apply the required configuration.


Troubleshooting

Installation issues

If the installation of the puppet package fails because of an error related to 'ruby(selinux)', you need to add the 'optional' software channel in redhat.

/var/log/messages

- If you get 'Could not request certificate: getaddrinfo: Name or service not known', you may need to add the following line in /etc/puppet/puppet.conf under the '[agent]' section: <verbatim> server = puppet.winsoft.fr </verbatim>

Useful links

- General issues: [[1]]

- Certificate issues: [[2]]