Hi Steven,

You might get quicker replies to your questions by using the Puppet
Enterprise Users group (
http://groups.google.com/a/puppetlabs.com/group/pe-users ) or the Puppet
Users group ( http://groups.google.com/group/puppet-users?pli=1 ) as this
group, the Puppet-dev group, is mainly for discussion of Puppet's core
internals and development of plugins to Puppet.

To answer your question, when you run the hiera binary from the command
line, you don't have access to Puppet's built-in variables (that's where
$::clientcert comes from - it's a built-in variable to Puppet that
evaluates out to being the certname of the node checking in) or Facter
facts.  You can SIMULATE this by doing the following:

hiera -d <key> clientcert=your_full_certname_here my_env=environment_name



On Wed, Sep 11, 2013 at 1:15 PM, Steven James <
[email protected]> wrote:

> Hi,
>
> I'm having some issues getting hiera to draw data from a subdirectory in
> it's hierarchy,
>
> I've set a custom fact to reveal what my working environment is. PE3.0.1
>
> i.e. facter -p my_env shows "test"
>
> My hiera.yaml has an extract like the following;
>
> :hierarchy:
>   - defaults
>   - "%{::clientcert}"
>   - "%{::my_env}/common"
>   - common
>
>
> I have a hieradata/test/common.yaml file with the required data I'm after.
>
> If I run a hiera -d for the variable I'm after, my datadir is found, but I
> can see that it only tries to parse defaults.yaml and common.yaml, but
> neither clientcert or my_env directories are searched or mentioned in the
> debug output.
>
> I've tried with and without the ::
>
> If I place my key pair in either defaults, or common, it's found
> successfully.
>
> ( Indeed, if I run facter clientcert, nothing is actually returned?? This
> is the default in the hiera.conf file I see. clientcert, rather than fqdn??
> )
>
> Does anybody have the correct syntax for Puppet 3 hiera to search in a
> subdirectory as above?
>
> This did work in PE2.8.
>
> Thanks
>
> Steven
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" 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-dev.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Gary Larizza
Professional Services Engineer
Puppet Labs

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to