Ask Your Question

Problem in creating hiera for my module

asked 2017-08-01 21:57:51 -0600

rohithmn03 gravatar image

Hi Team,


class aoa_agent_installation::agent_install(String $myowner, String $mygroup, String $myuser, String $myhome) {

Now i want all the 4 variables ( myowner, mygroup, myuser, myhome) to be defined in a single hiera file. All these variables values differs per hosts/servers/nodes.

Now how can i have a single hiera file that my class agent_install.pp should look for variables values for all the attached nodes/servers.

Regards, Rohith

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-08-02 16:33:25 -0600

eric aldinger gravatar image

use Hiera environments for that. Note that $myuser may be something you want passed into Puppet rather than saved in Hiera files. It is often a sensitive element (along with password, certs, and tokens) that is best not to check into your source control repo (especially if it is a public repo).

edit flag offensive delete link more

answered 2017-08-02 06:17:02 -0600

CBR gravatar image

You can go through Hiera documentation on how to achieve that.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-08-01 21:57:51 -0600

Seen: 48 times

Last updated: Aug 02 '17