- Lab
- A Cloud Guru
Installing Open Source Puppet
Puppet is a configuration management tool that allows us to enforce consistent configurations across multiple platforms, and Puppet open source even lets us do it for free. In this lab, we'll configure an open source Puppet master on a CentOS 7 server, then start bringing our infra under Puppet's control by installing the Puppet agent on a second node. We'll also make sure our certificate authority is up and running by accepting our node's cert on the master.
Path Info
Table of Contents
-
Challenge
Install the Puppet Server on the CentOS 7 node
Update the
/etc/hosts
information:$ sudo $EDITOR /etc/hosts 127.0.0.1 puppet localhost localhost.localdomain localhost4 localhost4.localdomain4
Add the Puppet 5 Platform repo:
$ sudo rpm -Uvh https://yum.puppet.com/puppet5-release-el-7.noarch.rpm
Install Puppet:
$ sudo yum install puppetserver
Start Puppet, making sure it uses no more than 1 GB of RAM:
$ sudo $EDITOR /etc/sysconfig/puppetserver JAVA_ARGS="-Xms1g -Xmx1g -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger" $ sudo systemctl start puppetserver $ sudo systemctl enable puppetserver
Ensure any Puppet commands can be used with
sudo
:$ sudo $EDITOR /etc/sudoers.d/99_extra Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin $ bash
-
Challenge
Install the Puppet agent on the Ubuntu 18.04 node
Update the
/etc/hosts
file with the private IP and name of the master:$ sudo $EDITOR /etc/hosts 10.0.1.100 puppet
Add the Puppet 5 Platform repository:
$ wget https://apt.puppetlabs.com/puppet5-release-bionic.deb $ sudo dpkg -i puppet5-release-bionic.deb $ sudo apt update
Install the Puppet agent:
$ sudo apt install puppet-agent
Start and enable Puppet:
$ sudo systemctl start puppet $ sudo systemctl enable puppet
Update the secure path:
$ sudo $EDITOR /etc/sudoers.d/99_extra Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin $ bash
-
Challenge
Sign the Ubuntu 18.04 node's cert on the master
On the Ubuntu 18.04 node, view the fingerprint of the node:
$ sudo puppet agent --fingerprint
One the master, list the pending certificates to sign:
$ sudo puppetserver ca list
If the fingerprints match (they should), sign the cert:
$ sudo puppetserver ca sign --certname node1.ec2.internal
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.