Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 257

Is it possible to have conditionals in hiera yaml?

$
0
0
I am trying to achieve following. - I have certain variables defined in hiera yaml for a.yaml - Some of the variables I want to read from the external facts. - However whenever an external fact is not defined I want to use some default. So for example --- key1: value1 key2: %{value2_from_facts} | value2 In this case if custom fact 'value2_from_facts' is not defined, I want key2 to have value2. Is this possible? Is there any better alternative to having defaults assigned to hiera variable if the facts used are not resolved?

Viewing all articles
Browse latest Browse all 257

Trending Articles