Setting Up Your First Puppet Master Server
If you’re managing servers and aren’t using an infrastructure-as-code solution such as Puppet, Ansible or Chef, be warned: you should be.
Other viable solutions are in the past, infrastructure-as-code tools allow businesses and IT to become much more agile, bringing entire environments up and down quickly with ease.
Puppet is one of the first of these solutions and is arguably still the most popular. Its architecture consists of a having one or more Puppet “masters” and nodes that are managed by the master. The master allows you to create the configurations as code, which
In this article, I’ll walk you through the process of setting up your very first
Prerequisites
For our example setup, I’ll be installing the Puppet master on a CentOS 7 VM and Puppet agent on another CentOS VM. Before we install Puppet, we need to ensure proper networking is in place. You’ll need name resolution working, either by DNS or via the host’s file. By default, the Puppet will assume that the hostname of your Puppet master is “puppet” and nodes will look for the master by this name. I’ll leave this configuration as is for this example.
First, let’s get some prerequisites in order. I want to set NTP and set my firewall to allow port 8140
Here, I ensure firewalld is started and enabled. I then allow port 8140:
[dan@puppet ~]$ sudo systemctl start firewalld [dan@puppet ~]$ sudo systemctl enable firewalld [dan@puppet ~]$ sudo firewall-cmd --permanent --zone=public --add-port=8140/tcp
Now I’ll install NTP, which is necessary since the puppet master acts as a certificate authority. To do this I will use the package manager Yum.
[dan@puppet ~]$ sudo yum install ntp
Next, let’s set our time zone and start the NTP service:
[dan@puppet ~]$ sudo timedatectl set-timezone America/New_York [dan@puppet ~]$ sudo systemctl start ntpd
Finally, I’ll enable NTP through the firewall:
[dan@puppet ~]$ sudo firewall-cmd --add-service=ntp --permanent
Installing the Puppet Server
Now it’s time to install the actual Puppet software. Once again, we can do this with Yum. Before we do this though,
[dan@puppet ~]$ sudo rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm [dan@puppet ~]$ sudo yum -y install puppetserver