Install Puppet Server On CentOS 7 - Unixmen
Install Puppet Server On CentOS 7 - Unixmen
Puppet is a tool designed to manage the configuration of Unix-like and Microsoft Windows systems
declaratively. The user describes system resources and their state, either using Puppet’s declarative
language or a Ruby DSL (domain specific language). This information is stored in files called “Puppet
manifests”. Puppet discovers the system information via a utility called Facter, and compiles the
Puppet manifests into a system-specific catalog containing resources and resource dependency,
which are applied against the target systems. Any actions taken by Puppet are then reported.
Scenario
In this tutorial i am going to use two systems as mentioned below.
Puppet Master:
Puppet client:
For Centos 7:
# Start Puppet-Server
http://www.unixmen.com/install-puppet-server-centos-7/ 1/8
9/1/2014 Install Puppet Server On CentOS 7 | Unixmen
Centos 7:
-------------------------------------------------------------------------------
/Service[puppetmaster]/ensure: ensure changed 'stopped' to 'running'
service { 'puppetmaster':
ensure => 'stopped',
enable => 'true',
}
Puppet needs a scalable web server in a non testing environment, so lets install apache (Official
Docs):
yum install -y httpd httpd-devel mod_ssl ruby-devel rubygems gcc-c++ curl-devel zlib-devel m
ake automake openssl-devel
# Install Rack/Passenger
Then
passenger-install-apache2-module
http://www.unixmen.com/install-puppet-server-centos-7/ 2/8
9/1/2014 Install Puppet Server On CentOS 7 | Unixmen
‣ Ruby
Python
Node.js
Meteor
--------------------------------------------
http://www.unixmen.com/install-puppet-server-centos-7/ 3/8
9/1/2014 Install Puppet Server On CentOS 7 | Unixmen
Found: yes
Location of apxs2: /usr/bin/apxs
* Checking for Rake (associated with /usr/bin/ruby)...
Found: yes
Location: /usr/bin/ruby /usr/local/bin/rake
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Ruby development headers...
Found: yes
Location: /usr/include/ruby.h
* Checking for rack...
Found: yes
* Checking for Apache Portable Runtime (APR) development headers...
Found: yes
Location: /usr/bin/apr-1-config
Version: 1.4.8
* Checking for Apache Portable Runtime Utility (APU) development headers...
Found: yes
Location: /usr/bin/apu-1-config
Version: 1.5.2
vi /etc/httpd/conf.d/puppetmaster.conf
and add:
# RHEL/CentOS:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.35/buildout/apache2/mo
d_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.35/
PassengerRuby /usr/bin/ruby
# And the passenger performance tuning settings:
PassengerHighPerformance On
PassengerUseGlobalQueue On
# Set this to about 1.5 times the number of CPU cores in your master:
PassengerMaxPoolSize 6
# Recycle master processes after they service 1000 requests
PassengerMaxRequests 1000
# Stop processes if they sit idle for 10 minutes
PassengerPoolIdleTime 600
Listen 8140
http://www.unixmen.com/install-puppet-server-centos-7/ 4/8
9/1/2014 Install Puppet Server On CentOS 7 | Unixmen
<VirtualHost *:8140>
SSLEngine On
# Only allow high security cryptography. Alter if needed for compatibility.
SSLProtocol All -SSLv2
SSLCipherSuite HIGH:!ADH:RC4+RSA:-MEDIUM:-LOW:-EXP
SSLCertificateFile /var/lib/puppet/ssl/certs/unixmen-centos7.arnhem.chello.nl.pem
SSLCertificateKeyFile /var/lib/puppet/ssl/private_keys/unixmen-centos7.arnhem.chello.nl
.pem
SSLCertificateChainFile /var/lib/puppet/ssl/ca/ca_crt.pem
SSLCACertificateFile /var/lib/puppet/ssl/ca/ca_crt.pem
SSLCARevocationFile /var/lib/puppet/ssl/ca/ca_crl.pem
SSLVerifyClient optional
SSLVerifyDepth 1
SSLOptions +StdEnvVars +ExportCertData
# These request headers are used to pass the client certificate
# authentication information on to the puppet master process
RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e
#RackAutoDetect On
DocumentRoot /usr/share/puppet/rack/puppetmasterd/public/
<Directory /usr/share/puppet/rack/puppetmasterd/>
Options None
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
</VirtualHost>
Start up Apache:
/etc/init.d/puppetmaster stop
/etc/init.d/httpd start
http://www.unixmen.com/install-puppet-server-centos-7/ 5/8
9/1/2014 Install Puppet Server On CentOS 7 | Unixmen
lsof -i tcp:8140
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 8743 root 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8747 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8748 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8749 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8750 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8751 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8752 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8753 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8754 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)
httpd 8755 apache 6u IPv6 74005 0t0 TCP *:8140 (LISTEN)ZZ
vim /etc/puppet/puppet.conf
[master]
certname = puppet-server #Use the FQDN here
autosign = true
Check the Apache configuration with an apachectl configtest and again fix any errors you encounter.
cp /usr/share/puppet/ext/rack/config.ru /usr/share/puppet/rack/puppetmasterd/
http://www.unixmen.com/install-puppet-server-centos-7/ 6/8
9/1/2014 Install Puppet Server On CentOS 7 | Unixmen
If you are not using DNS in your envrionment, you will need to manually edit your hosts file on both
machines .
vim /etc/hosts
10.1.x.x node
10.1.x.y puppet-server
vim /etc/puppet/puppet.conf
# In the [agent] section
chkconfig puppet on
puppet agent --daemonize
puppet agent -t
Info: Caching certificate for ca
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for localhost.unixmen.com
Info: Certificate Request fingerprint (SHA256): 51:E3:75:7D:EC:BA:1F:68:B1:94:5E:4D:1F:84:53:
07:F6:67:18:AB:12:6A:B6:89:05:D9:19:9F:30:DB:7A:F8
Info: Caching certificate for ca
Exiting; no certificate found and waitforcert is disabled
http://www.unixmen.com/install-puppet-server-centos-7/ 7/8
9/1/2014 Install Puppet Server On CentOS 7 | Unixmen
Enjoy!
http://www.unixmen.com/install-puppet-server-centos-7/ 8/8