January 1, 2015

Puppet – Install Hiera

Before you can start using hiera, you first need to install the hiera rpm package as well as the hiera gem. You only isntall hiera on the master. However if you are managing a standalone agent, then you need to install it on these agents too.


You can find all my latest posts on medium.

To check if hiera rpm is already installed do:

[root@puppetmaster ~]# rpm -qa | grep "hiera"
[root@puppetmaster ~]#

If nothing is outputted, then you can do:

yum install hiera

or get puppet to install it for you:

[root@puppetmaster ~]# puppet resource package hiera ensure=installed

Next you need the hiera gem installed. You can check if that is so by running:

[root@puppetmaster ~]# gem list

*** LOCAL GEMS ***

json (1.5.5)
[root@puppetmaster ~]#

If it’s not installed then do:

[root@puppetmaster /]# gem install hiera
Successfully installed json_pure-1.8.1
Successfully installed hiera-1.3.4
2 gems installed
Installing ri documentation for json_pure-1.8.1...
Installing ri documentation for hiera-1.3.4...
Installing RDoc documentation for json_pure-1.8.1...
Installing RDoc documentation for hiera-1.3.4...
[root@puppetmaster /]#

This also installs all dependencies. After that you should find the hiera gem is now installed:

[root@puppetmaster /]# gem list

*** LOCAL GEMS ***

hiera (1.3.4)
json (1.5.5)
json_pure (1.8.1)
[root@puppetmaster /]#