Installation and Configuration: Puppet Server

Length: 00:15:02

Lesson Summary:

Puppet Open Source (and Puppet Enterprise) only supports master-agent setups now, and recommends using the Java Virtual Machine-based Puppet Server for the master, not the older, Ruby-based Puppet Master application.

We'll be using Ubuntu 18.04 for our Puppet Server. The size of the server needed for the Puppet differs, depending on how many agents that server will support:

>10 >1000
Cores 2 4

Since we'll only be using two agents in this quick start, we have two options if we're using Linux Academy's Cloud Playground: We can use the Small-sized server and make some configuration changes during installation, or we can use the Medium-sized server, which meets the minimum Puppet requirements for master servers managing between 10 and 1000 agent nodes.

Still using Linux Academy's old-style Cloud Servers? That's okay! Follow the instructions as though you were setting up Puppet Server on a small-sized playground server.

We'll be working as root in this lesson. Use sudo -i to switch from the default cloud_user to root.

Add the Puppet Repository

Puppet maintains its own repositories for all supported Puppet Server distributions, including:

  • Red Hat Enterprise Linux and derived distros
  • Debian
  • Fedora
  • Ubuntu

To add the Puppet repository in Ubuntu, use:

# wget
# dpkg -i puppet6-release-bionic.deb
# apt update

If we want, we can also remove the .deb package now that the repository is set up:

# rm puppet6-release-bionic.deb

Install the Puppet Server Package

Before we install the puppetserver package from our newly-added repo, let's ensure our hosts file is properly set up. By default, our cloud playground has public hostnames we can use. We want to change one of these to work within our internal network.

Open /etc/hosts and move the hostname mapping to the localhost: \<LABSERVERID\> localhost puppet

You may also want to add puppet as a hostname.

Install the Puppet Server:

# apt-get install puppetserver

Configure Puppet Server

While Puppet can detect the hostname by default, with our playground servers, it needs a little help. Configurations used for initial Puppet Server startup and certificate generation are found at /etc/puppetlabs/puppet/puppet.conf. Specifically, we want to add the certname value to both the [main] and [master] sections:

certname = \<LABSERVERID\>

certname = \<LABSERVERID\>
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/
codedir = /etc/puppetlabs/code

For Small Servers Only

If we're using a smaller server, then prior to starting the Puppet Server daemon we also need to make some changes to the /etc/default/puppetserver file, to limit the memory allocation:

JAVA_ARGS="-Xms1g -Xmx1g -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger"

If the Puppet Server fails to start, or has memory issues later on, drop the memory values farther. To set to 512 MB instead, use:

JAVA_ARGS="-Xms512m -Xmx512m -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger"

Set Up the Certificate Authority

Puppet manages its own intermediate signing CA. Before we start the Puppet Server for the first time, we need to run the CA setup:

/opt/puppetlabs/bin/puppetserver ca setup

Start the Puppet Server

We can now start the Puppet Server (and enable it to start when the system boots) with:

# systemctl start puppetserver
# systemctl enable puppetserver

To start using the puppetserver command instead of the full path, we can refresh our bash prompt, then check our CA list to make sure the Puppet Server has no issues communicating through the certname we set up:

# exit
# sudo -i
# puppetserver ca list

This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More