Ask Your Question
0

Global hiera datadir?

asked 2014-01-09 10:19:00 -0600

josh gravatar image

updated 2014-01-09 10:19:22 -0600

My hiera configuration looks like this:

---
:hierarchy:
    - node/%{fqdn}
    - cluster/%{cluster}
    - app/%{app}
    - location/%{location}
    - org/%{organization}
    - common

:yaml:
        :datadir: '/etc/puppetlabs/puppet/hieradata/%{::environment}'

As you can see, I have environment-specific hiera datadirs as we maintain separate data for each environment. Is there anyway with this configuration that I can create a 'global' data source/hierachy that would be evaluated for EVERY environment? I would like to store very common things here, like users. I have a common.yaml for each environment, but need one that covers all environments.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-01-09 10:48:38 -0600

josh gravatar image

Ok, this is how I solved my problem:

---
:hierarchy:
    - "%{::environment}/node/%{fqdn}"
    - "%{::environment}/cluster/%{cluster}"
    - "%{::environment}/app/%{app}"
    - "%{::environment}/location/%{location}"
    - "%{::environment}/org/%{organization}"
    - "%{::environment}/common"
    - global/common

:yaml:
        :datadir: '/etc/puppetlabs/puppet/hieradata'
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

Stats

Asked: 2014-01-09 10:19:00 -0600

Seen: 52 times

Last updated: Jan 09 '14