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 ...")
 
 
(5 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
Example (you need to change IP and insert position):
 
Example (you need to change IP and insert position):
<verbatim>
+
<pre>
 
iptables -I INPUT 8 -s 188.165.38.75 -m tcp -p tcp --dport 8140 -j ACCEPT
 
iptables -I INPUT 8 -s 188.165.38.75 -m tcp -p tcp --dport 8140 -j ACCEPT
</verbatim>
+
</pre>
  
 
=== Client side ===
 
=== Client side ===
Line 14: Line 14:
 
==== CentOS / RHEL ====
 
==== CentOS / RHEL ====
  
In this doc, we assume the master is located at puppet.winsoft-international.com
+
In this doc, we assume the master is located at puppet.lunasys.fr
  
- [[Public.EPEL][Add EPEL]]
+
- Add EPEL
  
 
- (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>
+
<pre>
 
[puppetlabs]
 
[puppetlabs]
 
name=Puppet Labs Packages
 
name=Puppet Labs Packages
Line 32: Line 32:
 
enabled=1
 
enabled=1
 
gpgcheck=0
 
gpgcheck=0
</verbatim>
+
</pre>
  
 
- Install puppet
 
- Install puppet
<verbatim>
+
<pre>
 
yum install -y puppet
 
yum install -y puppet
 
chkconfig puppet on
 
chkconfig puppet on
</verbatim>
+
</pre>
  
- 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>
+
<pre>
 
[main]
 
[main]
 
     logdir = /var/log/puppet
 
     logdir = /var/log/puppet
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
</verbatim>
+
</pre>
  
 
- Register with the master
 
- Register with the master
  
<verbatim>
+
<pre>
puppetd --waitforcert 30 --server puppet.winsoft.fr -v
+
puppetd --waitforcert 30 --server puppet.lunasys.fr -v
</verbatim>
+
</pre>
  
 
==== Debian ====
 
==== Debian ====
Line 68: Line 68:
 
- Install puppet
 
- Install puppet
  
<verbatim>
+
<pre>
 
apt-get install puppet
 
apt-get install puppet
</verbatim>
+
</pre>
  
 
- Edit configuration file =/etc/puppet/puppet.conf= to have:
 
- Edit configuration file =/etc/puppet/puppet.conf= to have:
  
<verbatim>
+
<pre>
 
[main]
 
[main]
 
     logdir = /var/log/puppet
 
     logdir = /var/log/puppet
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
</verbatim>
+
</pre>
  
 
- Register with the master
 
- Register with the master
  
<verbatim>
+
<pre>
puppetd --waitforcert 30 --server puppet.winsoft.fr -v
+
puppetd --waitforcert 30 --server puppet.lunasys.fr -v
</verbatim>
+
</pre>
  
 
=== On the server - Finalization ===
 
=== On the server - Finalization ===
Line 102: Line 102:
  
 
First, list requests:
 
First, list requests:
<verbatim>
+
puppetca -l
puppetca -l
 
</verbatim>
 
  
 
Select the hostname of the wanted server and allow it:
 
Select the hostname of the wanted server and allow it:
<verbatim>
+
puppetca -s <hostname>
puppetca -s <hostname>
+
 
</verbatim>
 
  
 
You're done. The client is registered and will apply the required configuration.
 
You're done. The client is registered and will apply the required configuration.
Line 122: Line 119:
 
==== /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>
+
server = puppet.lunasys.fr
server = puppet.winsoft.fr
 
</verbatim>
 
  
 
==== Useful links ====
 
==== Useful links ====
  
- General issues: [[http://docs.puppetlabs.com/guides/troubleshooting.html]]
+
- [http://docs.puppetlabs.com/guides/troubleshooting.html General issues]
  
- Certificate issues: [[http://projects.puppetlabs.com/projects/1/wiki/Certificates_And_Security]]
+
- [http://projects.puppetlabs.com/projects/1/wiki/Certificates_And_Security Certificate issues]

Latest revision as of 14:29, 18 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):

iptables -I INPUT 8 -s 188.165.38.75 -m tcp -p tcp --dport 8140 -j ACCEPT

Client side

CentOS / RHEL

In this doc, we assume the master is located at puppet.lunasys.fr

- Add EPEL

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

vim /etc/yum.repos.d/puppet.repo
[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

- Install puppet

yum install -y puppet
chkconfig puppet on

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

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

[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

- Register with the master

puppetd --waitforcert 30 --server puppet.lunasys.fr -v

Debian

- Install puppet

apt-get install puppet

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

[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

- Register with the master

puppetd --waitforcert 30 --server puppet.lunasys.fr -v

On the server - Finalization

- Allow the new client:

First, list requests:

puppetca -l

Select the hostname of the wanted server and allow it:

puppetca -s <hostname>


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:

server = puppet.lunasys.fr

Useful links

- General issues

- Certificate issues