Skip to main content

Refactoring a Puppet Module to Use Hiera

Hands-On Lab


Photo of

Training Architect





When writing Puppet modules, we have to be cautious of anything that will differ depending on the operating system or role. To account for these differences in Puppet, we have two different methods of storing variables that can be used in place of any attribute that will change depending on our node's traits: the params pattern, and Hiera.

In this lab, you are supplied with a MySQL module that has already been set up to use the params pattern. However, we want to refactor our module to use Hiera instead, completely eliminating the params option for our module. To do this, we need to understand both how params work, and how to set up Hiera to mimic that same behavior, proving that we are able to manage a module regardless of its creation process.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.