FAQ
Greetings,

Thanks for the suggestions. I stepped out for a bit, but will try it as
soon as I get back.
On 07/23/2015 05:15 PM, Ellison Marks wrote:
As far as I'm aware, in the default setup, there is no top level
hieradata. as the comment says, the default datadir is

/etc/puppetlabs/code/environments/%{environment}/hieradata

So each environment will have it's own hieradata directory with it's own
common.yaml. /etc/puppetlabs/code/hieradata will never be looked in.
OK. I guess I miss understood that. I thought I would be able to define
different types of environments which would be populated by that
%{environment} variable. Thus, I thought there was something in the top
level to tell the nodes which %{environment} variable (and subsequently
which hieradata directory) to use.

I can see some possible ways to accomplish your goal. The braindead one
is to just link common.yaml into each environment's hieradata.
So every host would be essentially defined in every common.yaml??
Doesn't that seem a little weird?
A slightly more interesting approach would look like this:

---
:backends:
- yaml
:hierarchy:
- "%{::environment}/%{::trusted.certname}" # or however you want files
organized under the environments
- common

:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
# -
%CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on
Windows
# When specifying a datadir, make sure the directory exists.
:datadir: /etc/puppetlabs/code/hieradata

Then your hieradata folder would look like this:

/etc/puppetlabs/code/hieradata/
common.yaml
production/
node1.example.com
node2.example.com
staging/
node3.example.com
dev/
node4.example.com
I will gladly give this a try as soon as I get a chance.

Thanks!!


--
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 puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/55B168D5.602%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 7 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJul 23, '15 at 9:23p
activeJul 24, '15 at 1:05p
posts7
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase