Utilising hashes in Hiera to reduce code complexity

Click for: original source

Darren Gipson wrote this piece about their effort to standardize the Puppet code design. They have moved as much of the data layer as possible to Hiera. Hiera is a built-in key-value configuration data lookup system, used for separating data from Puppet code.

Moving the data layer to Hiera means that we only have to understand a simple yaml file when building a new environment. This allows for great code reuse and helps explain to others not familiar with our Puppet code where the settings are.

Hiera was the clear solution for their problem because it provides you with an entry point to store data that you can then read with Puppet code.

The article discusses:

  • Business problem – migration to cloud-based services,
  • Solution
  • Complex examples

Using hashes in Hiera in certain way allows your Puppet code to be very data-driven, preventing the need to write the same code twice and providing flexibility for different configurations across environments. For details and code example follow the link to full article. Very good!

[Read More]

Tags devops cloud cicd web-development