Puppet certification 2015 study guide

The following is a study guide for the Puppet Certified Professional 2105 certification. It is based on the official exam objectives with links to the relevant documentation. When done, it would be good to take the practice exam a couple of times. I will say that I found the 2014 exam significantly more difficult than the practice exam.

Exam Objectives

Language

Modules

Using Puppet

Puppet Internals

Classification

Describe classification

Console

Ecosystem




Error: undefined method downcase

I’ve got multiple versions of puppet installed on my machine:

1) 3.x for regular use
2) 2.7 to generate puppetdoc. Puppetdoc is buggy in 3.x so I had to install an older version

I installed puppet 2.7 in my user’s .gem folder under the home dir (~/.gem). When I run puppet, I get an error:


Error: undefined method `downcase' for # at /vagrant/dev_puppet/manifests/site.pp:1 on node

It is either a bug in puppet 2.7 or I am missing some gems in my 2.7 .gem installation. The temporary fix is to rename .gem folder when running puppet runs on 3.x, and move it back when i need to run puppetdoc from the .gem folder.

A more elegant solution would have been to install puppet into it’s own environment using rvm or something similar.




create_resources and hiera

When using create_resources to instantiate defined resources with hiera, it is a good practice to include the last parameter to the create_resources function – the defaults parameter. The easiest thing is to set the default to an empty hash ‘{}’. If you don’t do this AND you don’t list the data item in hiera, you will see an error like:


Error: Could not find data item etc_host in any Hiera data file and no default supplied at /vagrant/dev_puppet/modules/hosts/manifests/hiera.pp:4 on node foo.foo.com

The fix is to set the default as an empty hash:

class hosts::hiera {

$etc_host = hiera('etc_host', {} )
create_resources('hosts::etchosts', $etc_host)

}