HowTo/InstallPuppetClient

From LunaSys
Jump to navigation Jump to search

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