Late to the party, but wanted to add my $.02
We also keep hiera, manifests, and modules in a single repository at the
moment. Since we use dynamic environments for development (as outlined
here: https://puppetlabs.com/blog/git-workflow-and-puppet-environments), we
also have a node-level variable called $our_environment that specifies
whether a box lives in dev/test/prod (We talk about "environment" being
where the puppet manifest is in the development cycle, and
"$our_environment" being where the node is in the development cycle). So
our hierarchy looks like this:
- %{our_environment}/%{fqdn}
- %{our_environment}/role_%{role}
- %{our_environment}
- common
Hiera finds its data in: /usr/local/puppet/%{environment}/hieradata
A node definition would look like:
node 'foo' {
$our_environment = 'development'
include mysql
include some::submodule
}
When in doubt, we set hiera variables at the %{fqdn} level. So there's some
duplication of common settings, but we avoid having too many questions
about where variables are getting set. Putting too many search layers into
hiera just reintroduces the problems that were supposed to be solved by
hiera in the first place (i.e. getting rid of the "inherits" stuff).
The biggest pain point for us is that having hiera + puppet in the same
repo feels like extra work. If they're going to live together, why even use
hiera? Why not just set variables at the node level? Rhetorical questions,
to be sure. But we have to live with hiera + puppet in the same repo since
otherwise we wouldn't be able to do dynamic environments (at least not
while developing modules that use hiera).
By the way - if you're asking for a wish list. I'd REALLY like to have
hiera be able to look in more than one directory path for configuration
variables. This way we could keep secure configuration information separate
from our normal DVCS. hiera-gpg ameliorates this somewhat, but I'd prefer
to solve that problem with plain YAML and a separate, secure path on the
puppet master.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.