dynamic hiera_config setting

429 views
Skip to first unread message

jamese

unread,
Aug 9, 2013, 3:59:49 AM8/9/13
to puppet...@googlegroups.com
Hi all,

I'm playing with a new setup of puppet 3.2.3 and hiera 1.2.0 on an EL6 server.

The puppet config is stored in a git repo (as per https://puppetlabs.com/blog/git-workflow-and-puppet-environments/)

I want to use a separate hiera.yaml file per environment, so in the puppet.conf, I have the following:

[master]
    hiera_config = /vagrant/puppetenv/$environment/hiera.yaml

    manifest   = /vagrant/puppetenv/$environment/manifests/site.pp
    modulepath = /vagrant/puppetenv/$environment/modules


For some reason, puppet keeps trying to look for the hiera.yaml file at: /vagrant/puppetent/production/hiera.yaml (confirmed via strace), regardless of which environment I use on the agent.
So it seems to be ignoring the $environment portion of the path.

I noticed there is a bug raised which seems related to this http://projects.puppetlabs.com/issues/11784

I know I could use a single hiera.yaml file across all environments, but this then makes hiera backend/hierarchy changes more difficult.

Is anybody able to clarify whether this should actually work or not?  The linked bug suggests that it will and/or it won't and/or it might. /confused

Thanks

James

Pablo Wright

unread,
Aug 12, 2013, 11:35:25 AM8/12/13
to puppet...@googlegroups.com
Hi James,
One thing to take into account here is that hiera_config is under the
[master] section, so it might not take into account settings in
[agent], such as the environment.
Try running puppet master --configprint environment to see if it's set
to the default (which is production).

Hope this helps!
Pablo D. Wright
Technical Operations - www.edrans.com
Buenos Aires: +54 11 5368 5839 - Ext. 8017 |
Las Vegas: +1 5057183014
> --
> 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...@googlegroups.com.
> To post to this group, send email to puppet...@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

jamese

unread,
Aug 13, 2013, 3:25:43 AM8/13/13
to puppet...@googlegroups.com
Hi Pablo,

Thanks for the response.

I've tried setting the environment in the master section, the agent section, the main section.
Regardless of whether I set the environment anywhere in the masters puppet.conf, it always looks for the hiera.yaml file in the production directory.

I was hoping that it would derive the hiera.yaml path dynamically from the clients' environment when it checks in, but this seems not to be the case.

Henrik Lindberg

unread,
Aug 13, 2013, 10:57:17 PM8/13/13
to puppet...@googlegroups.com
On 2013-13-08 24:25, jamese wrote:
> Hi Pablo,
>
> Thanks for the response.
>
> I've tried setting the environment in the master section, the agent
> section, the main section.
> Regardless of whether I set the environment anywhere in the masters
> puppet.conf, it always looks for the hiera.yaml file in the production
> directory.
>
> I was hoping that it would derive the hiera.yaml path dynamically from
> the clients' environment when it checks in, but this seems not to be the
> case.
>
That is correct, it does not do that.
- henrik



Alex Harvey

unread,
Jun 17, 2014, 8:47:20 PM6/17/14
to puppet...@googlegroups.com


On Wednesday, August 14, 2013 12:57:17 PM UTC+10, Henrik Lindberg wrote:

> I was hoping that it would derive the hiera.yaml path dynamically from
> the clients' environment when it checks in, but this seems not to be the
> case.
>
That is correct, it does not do that.
- henrik

I am also encountering this issue (puppet 3.3.1) - is it still a known issue?

Alex Harvey

unread,
Jun 17, 2014, 10:02:16 PM6/17/14
to puppet...@googlegroups.com

On Wednesday, June 18, 2014 10:47:20 AM UTC+10, Alex Harvey wrote:

I am also encountering this issue (puppet 3.3.1) - is it still a known issue?

Ignore - I found the open Jira ticket here
Reply all
Reply to author
Forward
0 new messages