Difference between revisions of "HowTo/InstallPuppetClient"
(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): | ||
− | < | + | <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 | ||
− | </ | + | </pre> |
=== Client side === | === Client side === | ||
Line 14: | Line 14: | ||
==== CentOS / RHEL ==== | ==== CentOS / RHEL ==== | ||
− | In this doc, we assume the master is located at puppet. | + | 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: | - (Optional: only if latest release required) Add the puppet repo: | ||
− | vim /etc/yum.repos.d/puppet.repo | + | vim /etc/yum.repos.d/puppet.repo |
− | < | + | <pre> |
[puppetlabs] | [puppetlabs] | ||
name=Puppet Labs Packages | name=Puppet Labs Packages | ||
Line 32: | Line 32: | ||
enabled=1 | enabled=1 | ||
gpgcheck=0 | gpgcheck=0 | ||
− | </ | + | </pre> |
- Install puppet | - Install puppet | ||
− | < | + | <pre> |
yum install -y puppet | yum install -y puppet | ||
chkconfig puppet on | chkconfig puppet on | ||
− | </ | + | </pre> |
− | - Make sure the hostname is fully qualified, eg ' | + | - Make sure the hostname is fully qualified, eg 'yuka.lunasys.fr' and not just 'yuka' |
− | - Edit configuration file | + | - Edit configuration file /etc/puppet/puppet.conf to have: |
− | < | + | <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. | + | server = puppet.lunasys.fr |
report = true | report = true | ||
pluginsync = true | pluginsync = true | ||
− | </ | + | </pre> |
- Register with the master | - Register with the master | ||
− | < | + | <pre> |
− | puppetd --waitforcert 30 --server puppet. | + | puppetd --waitforcert 30 --server puppet.lunasys.fr -v |
− | </ | + | </pre> |
==== Debian ==== | ==== Debian ==== | ||
Line 68: | Line 68: | ||
- Install puppet | - Install puppet | ||
− | < | + | <pre> |
apt-get install puppet | apt-get install puppet | ||
− | </ | + | </pre> |
- Edit configuration file =/etc/puppet/puppet.conf= to have: | - Edit configuration file =/etc/puppet/puppet.conf= to have: | ||
− | < | + | <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. | + | server = puppet.lunasys.fr |
report = true | report = true | ||
pluginsync = true | pluginsync = true | ||
− | </ | + | </pre> |
- Register with the master | - Register with the master | ||
− | < | + | <pre> |
− | puppetd --waitforcert 30 --server puppet. | + | puppetd --waitforcert 30 --server puppet.lunasys.fr -v |
− | </ | + | </pre> |
=== On the server - Finalization === | === On the server - Finalization === | ||
Line 102: | Line 102: | ||
First, list requests: | First, list requests: | ||
− | + | puppetca -l | |
− | puppetca -l | ||
− | |||
Select the hostname of the wanted server and allow it: | Select the hostname of the wanted server and allow it: | ||
− | + | puppetca -s <hostname> | |
− | puppetca -s <hostname> | + | |
− | |||
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 | + | - 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 | |
− | server = puppet. | ||
− | |||
==== Useful links ==== | ==== Useful links ==== | ||
− | - | + | - [http://docs.puppetlabs.com/guides/troubleshooting.html General issues] |
− | - | + | - [http://projects.puppetlabs.com/projects/1/wiki/Certificates_And_Security Certificate issues] |
Latest revision as of 14:29, 18 October 2012
Contents
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