Puppet is a configuration management tool to help in automating the provision, config and management of servers. Here we will show how to install Puppet Master.
This tutorial will assume that you have a Centos 8 server already running.
1 – Install Puppetlabs Repository
dnf install https://yum.puppetlabs.com/puppet-release-el-8.noarch.rpm
The repo addition can be confimerd by running dnf repolist
[root@puppet ~]# dnf repolist
repo id repo name
AppStream CentOS-8 - AppStream
BaseOS CentOS-8 - Base
extras CentOS-8 - Extras
puppet Puppet Repository el 8 - x86_64
2 – Install Puppet server
To install puppet, with all needed dependencies, like java, run:
# dnf install puppetserver
3 – Configuration files
Service configuration file can be found in /etc/sysconfig/puppetserver
where, for example, memory usage can be configured.
To configure puppet master, the configuration file will be inside /etc/puppetlabs/
puppet/. The file will be pupper.conf
In this file, FQDN name of the master node should be defined under [master] section and main configuration, under [main]:
[master]
dns_alt_names=puppet.local
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
[main]
certname = puppet.local
server = puppet.local
environment = production
runintercal = 10m
Now just enable and start the service:
systemctl enable puppetserver
systemctl start puppetserver
4 – Add the Agent to PuppetMaster
In puppet master run:/opt/puppetlabs/bin/puppetserver ca list
The Agent should show listed.
Sign the Agent with:
/opt/puppetlabs/bin/puppetserver ca sign –certname agent01.local
5 – Verify Agent Configuration
/opt/puppetlabs/bin/puppet agent –test