Ask Your Question

Is there a way to get hiera to "forget" an assignment from lower in the hierarchy?

asked 2015-05-01 18:12:58 -0600

JohnsonEarls gravatar image

updated 2015-05-01 18:14:28 -0600

This seems like very much a newbie question, but my google-fu is failing.

Say I have a hiera hierarchy that looks like...

  - node/{::fqdn}
  - domain/{::domain}
  - global

I want every node except one to have a particular setting. Rather than having to create a separate node/foo.yaml file for every other node, is there a way I can assign the value in global.yaml and then cause it to be unassigned in node/specialnode.yaml ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-05-01 19:10:40 -0600

ramindk gravatar image

updated 2015-05-01 19:26:08 -0600

This is a weird one and I picked it up on the puppet mailing list some time ago. Now I can't find any reference to why this works. The ~ character will unset the value rather than returning blank.

key: ~

However by setting this, Hiera will not return a value for that key even if it exists in a lower in the hierarchy. That might work if you can rely on the default in the module or instantiate the class with default params.

edit flag offensive delete link more


No idea why, but you're right, this works. Thanks!

JohnsonEarls gravatar imageJohnsonEarls ( 2015-05-01 20:48:19 -0600 )edit

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: 2015-05-01 18:12:58 -0600

Seen: 68 times

Last updated: May 01 '15