Ask Your Question
1

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

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

JohnsonEarls gravatar image

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

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

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

:hierarchy:
  - 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
1

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

ramindk gravatar image

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

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

Comments

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

JohnsonEarls gravatar imageJohnsonEarls ( 2015-05-01 20:48:19 -0500 )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

Stats

Asked: 2015-05-01 18:12:58 -0500

Seen: 67 times

Last updated: May 01 '15