%{hiera('otherkey')} working in Hiera-CLI, but not in Puppet

73 views
Skip to first unread message

Ger Apeldoorn

unread,
Dec 3, 2013, 3:39:25 AM12/3/13
to puppe...@googlegroups.com
We're having some issues with the implementation of this feature-request: https://projects.puppetlabs.com/issues/21367

We are using a Puppet setup with foreman.

Versions:
- puppet 3.3.2
- hiera 1.3.0
- CentOS release 6.4

I have got this in common.yaml
---
test1: "test1 -> %{hiera('test2')}"
test2: Dit is test2

When I do a Hiera call for test1 on the CLI, it works as expected:

#hiera -c /etc/puppet/hiera.yaml test1
test1 -> Dit is test2

However, if I try to use this from within Puppet, the %{hiera('test2')} is replaced by a blank.

#puppet apply -e 'notice(hiera("test1"))'
Notice: Scope(Class[main]): test1 ->

Also with a full Puppet run:

# puppet agent -t --environment devrepo
*snip*
Notice: test1 -> 
Notice: /Stage[main]//Node[default]/Notify[test1 -> ]/message: defined 'message' as 'test1 -> '
Notice: Finished catalog run in 4.60 seconds

I would expect that the CLI would yield the same results as the call from within Puppet.

Any ideas?

Thanks,
Ger.

Erik Dalén

unread,
Dec 4, 2013, 4:57:48 AM12/4/13
to Puppet Developers
hiera cli and hiera in puppet use two different config files. So does puppet apply -e 'notice(hiera("test2"))' work as expected for you?


--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/bcfd309b-01a2-4e3e-b444-efae8f65ffe9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Erik Dalén

Ger Apeldoorn

unread,
Dec 13, 2013, 8:20:26 AM12/13/13
to puppe...@googlegroups.com
Apologies for the delay...

I have added the configfile on the CLI, so they should use the same one.

puppet apply -e 'notice(hiera("test1"))' does not give the expected result.

Thanks,
Ger.

Op woensdag 4 december 2013 10:57:48 UTC+1 schreef Erik Dalén:

Erik Dalén

unread,
Dec 13, 2013, 8:37:57 AM12/13/13
to Puppet Developers
On 13 December 2013 14:20, Ger Apeldoorn <in...@gerapeldoorn.nl> wrote:
Apologies for the delay...

I have added the configfile on the CLI, so they should use the same one.

puppet apply -e 'notice(hiera("test1"))' does not give the expected result.

right, but I asked if puppet apply -e 'notice(hiera("test2"))' gives the expected result :)


For more options, visit https://groups.google.com/groups/opt_out.



--
Erik Dalén

Ger Apeldoorn

unread,
Dec 13, 2013, 8:41:48 AM12/13/13
to puppe...@googlegroups.com
Ah, I assumed it was a typo.. :)

Yes, that works as expected.

Thanks,
Ger.

Op vrijdag 13 december 2013 14:37:57 UTC+1 schreef Erik Dalén:

Ger Apeldoorn

unread,
Jan 8, 2014, 8:53:08 AM1/8/14
to puppe...@googlegroups.com
Just updated hiera & puppet packages, this works as expected now. 

Thanks,
Ger

Op vrijdag 13 december 2013 14:41:48 UTC+1 schreef Ger Apeldoorn:
Reply all
Reply to author
Forward
0 new messages