Installing Puppet 5

Puppet 5 Agent on Ubuntu Trusty and Xenial

Joaquín Menchaca (智裕)
3 min readApr 13, 2018

--

You would think this should be a straight forward task, but no, unfortunately, alas, no, it is not. Forces are at work to stop you from getting Puppet.

Ubuntu Packages Blocking Puppet

Ubuntu has Puppet 3 package available in its official repositories, and they have started on Puppet 4 and Puppet 5 packages, but for whatever reasons never completed them. Thus with Ubuntu you are forever locked to Puppet 3, so don’t, really DON’T, do apt-get install puppet, as that will get you lost.

Puppet Docs Blocking Puppet

This may be why Puppet has renamed the package to puppet-agent to avoid Ubuntu’s alternative management style with the puppet package. In any event, reading the docs on Puppet’s website, this won’t be apparent.

Puppet’s docs will instruct you to download an installer that installs the repository entry and public key, so that then you can go install puppet on your own.

Yes, that is correct, the installer DOES NOT INSTALL Puppet. And then afterward, after reading tomes of text, it doesn’t really tell you how to install it.

In any event, here’s how to get Puppet 5 (puppet-agent), Puppet Development Kit (pdk), and the new tool bolt on your system so you can play around with these tools.

Installing Puppet

This process has been tested on both Ubuntu 14.04 Trusty and Ubuntu 16.04 Xenial.

Install GPG Key

When using a third party repository, you want to install a public signing key to verify that the packages are actually from the folks that made the package, the company Puppet in this case naturally.

sudo apt-key adv \
--keyserver "pgp.mit.edu" \
--recv-keys "EF8D349F"

Add Repository Entry

Now we have to tell Ubuntu about our third party repository and reference it for installing Puppet:

echo "deb http://apt.puppetlabs.com $(lsb_release -c -s) puppet5" \
| sudo tee -a /etc/apt/sources.list.d/puppet5.list
sudo apt-get update

You verify that you are pointing to the correct source for puppet-agent, pdk, and bolt.

apt-cache policy puppet-agent bolt pdk

Install the Goods

Now we can aptly install the packages from PuppetLab’s repository:

sudo apt-get install -y puppet-agent bolt pdk

Optionally added new tools from Puppet, bolt a simple remote execute tool and pdk(Puppet Dev Kit), a toolset for creating Puppet modules.

Wait, We’re Not Done

So we have the packages installed, and we type puppet and we get the following feedback:

-bash: puppet: command not found

Bummer.

No, We’re not going to take it! Let’s make these puppies available:

After running this fancy schmancy bash snippet, we can check our versions now:

As of April 13, 2018, if none of the programs crash (stack trace), this shows us:

puppet: 5.5.0
facter: 3.11.0
hiera: 3.4.2
mco: 2.12.0
bolt: 0.19.0
pdk: 1.4.1

And it crashes…

But a program did stack trace?!?!

Game Over Man!

Well, actually, I had this happen with mco on Ubuntu 16.04. Fortunately, I have a version of ruby 2.4 installed, so I can fix this by gem install stomp. If you don’t have ruby 2.4, well, then get it!

You can install ruby 2.4 easily by using either RVM or rbenv. I even wrote a few articles on these:

and

Final Thoughts

Let me know if it helps or what you think. I used to work exclusively in Puppet back in 2013 and so wanted to check out the latest. I knew if I had problems, maybe others had problems as well. Drop some comments if this helped you…

--

--

Joaquín Menchaca (智裕)
Joaquín Menchaca (智裕)

Written by Joaquín Menchaca (智裕)

DevOps/SRE/PlatformEng — k8s, o11y, vault, terraform, ansible

Responses (1)