Pay your attention, Puppet server name must follow RFC952 :

A “name” (Net, Host, Gateway, or Domain name) is a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-), and period (.). Note that periods are only allowed when they serve to delimit components of “domain style names”.

 

As you know, Oracle Linux looks like RedHat Enterprise Linux and CentOS …

[root@puppetserver ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)

Puppet Server installation

Download Puppet repository

To download the Community Edition :

Repositories are defined in Puppet Community Edition collections

Don’t worry about Java, Ruby and others, they will come as dedicated distribution for Puppet.

Install the required RPM :

[root@puppetserver ~]# rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
Retrieving https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
warning: /var/tmp/rpm-tmp.uOIkiE: Header V4 RSA/SHA1 Signature, key ID 4bd6ec30: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:puppetlabs-release-pc1-1.0.0-2.el################################# [100%]

You have a new repository :

[root@puppetserver ~]# yum repolist | grep puppet
puppetlabs-pc1/x86_64 Puppet Labs PC1 Repository el 7 - x86_64                98

Install Puppet server :

[root@puppetserver ~]# yum -y install puppetserver
---
---
---
Installed:
  puppetserver.noarch 0:2.6.0-1.el7

Dependency Installed:
  java-1.8.0-openjdk-headless.x86_64 1:1.8.0.111-1.b15.el7_2  javapackages-tools.noarch 0:3.4.1-11.el7  libjpeg-turbo.x86_64 0:1.2.90-5.el7
  libxslt.x86_64 0:1.1.28-5.0.1.el7                           lksctp-tools.x86_64 0:1.0.13-3.el7        puppet-agent.x86_64 0:1.7.1-1.el7
  python-javapackages.noarch 0:3.4.1-11.el7                   python-lxml.x86_64 0:3.2.1-4.el7          tzdata-java.noarch 0:2016h-1.el7

Complete!

Remark : you have Puppet agent installed as well.

Configure and start Puppet Server

Both Puppet server and agent are currently stopped :

[root@puppetserver ~]# systemctl list-unit-files | grep -i puppet
puppet.service                            disabled
puppetserver.service                      disabled

For more convenience, create a symbolic link :

[root@puppetserver ~]# find / -name puppet -type f -ls
51843541    4 -rw-r--r--   1 root     root           92 Jun 13 20:23 /etc/sysconfig/puppet
233581    4 -rwxr-xr-x   1 root     root          179 Jun 13 20:35 /opt/puppetlabs/puppet/bin/puppet
[root@puppetserver ~]# ln -s /opt/puppetlabs/puppet/bin/puppet /usr/local/sbin

Reduce amount a memory used by Java :

  • We have less than 4GB of memory allocated to this virtual machine :
[root@puppetserver ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3687         104        2833           8         749        3500
Swap:          1639           0        1639
[root@puppetserver ~]# systemctl status puppetserver | grep Loaded
   Loaded: loaded (/usr/lib/systemd/system/puppetserver.service; disabled; vendor preset: disabled)
[root@puppetserver ~]# grep EnvironmentFile /usr/lib/systemd/system/puppetserver.service
EnvironmentFile=/etc/sysconfig/puppetserver
  • Edit this configuration file :
[root@puppetserver ~]# grep JAVA_ARGS /etc/sysconfig/puppetserver
 JAVA_ARGS="-Xms512m -Xmx1g -XX:MaxPermSize=256m"

Here, Java runtime will start with 512 MB and will consumme up to 1GB of memory.

Puppet requires FQDN (we haven’t any DNS is this lab), so edit “/etc/hosts” file :

[root@puppetserver ~]# grep puppetserver /etc/hosts
192.168.1.151   puppetserver.argonay.wou

Here is my FQDN :

[root@puppetserver ~]# hostname -f
puppetserver.argonay.wou

Start Puppet server

Start Puppet server, but don’t start Puppet agent at the moment :

[root@puppetserver ~]# systemctl start puppetserver

Keep it started across a reboot :

[root@puppetserver ~]# systemctl enable puppetserver
Created symlink from /etc/systemd/system/multi-user.target.wants/puppetserver.service to /usr/lib/systemd/system/puppetserver.service.

Configure Puppet agent on this server

Display the configuration directory :

[root@puppetserver ~]# puppet config print confdir
/etc/puppetlabs/puppet

This CONFDIR directory contains :

[root@puppetserver ~]# ls -l /etc/puppetlabs/puppet
total 20
-rw-r--r--. 1 root   root   4449 Jun 13 20:23 auth.conf
-rw-r--r--. 1 root   root    371 Jun 13 20:22 hiera.yaml
-rw-r--r--. 1 root   root    697 Jun 25 18:20 puppet.conf
drwxrwx--x. 8 puppet puppet 4096 Jun 25 19:37 ssl

Add “agent” paragraph in “puppet.conf” :

[root@puppetserver ~]# egrep -v "^#" /etc/puppetlabs/puppet/puppet.conf
[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code

[agent]
server = puppetserver.argonay.wou

Launch Puppet agent :

[root@puppetserver ~]# puppet agent -tv
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for puppetserver.argonay.wou
Info: Applying configuration version '1477732702'
Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
Notice: Applied catalog in 0.05 seconds

Which release ?

[root@puppetserver ~]# puppet --version
4.7.0

Great, this Puppet agent works fine on this Puppet server !

 

PDF24    Send article as PDF   

Leave a Reply

Your email address will not be published. Required fields are marked *


*