Ask Your Question

Get hiera value from the env I am not running

asked 2013-10-10 02:00:28 -0600

shyp gravatar image

Hello ,

considering I am intrest in knowing value of a parameter from other env ,

Can I run something like this :

hiera -c /etc/puppet/hiera.yaml webname env=live

from class .

Thanks ,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-10 10:03:49 -0600

Ancillas gravatar image

No, you can't.

What does your data look like? Can it be restructured?

Another option might be to put your values into a common file, and then make $env part of the key.

Say you have two environments: production and dev.

production::data:  'this is production'
dev::data: 'this is dev'

Then in your class you could do this.

$data           = hiera("${env}::data")
$other_env_data = hiera('dev::data')
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


Asked: 2013-10-10 02:00:28 -0600

Seen: 51 times

Last updated: Oct 10 '13