Hiera 5 calling_class

134 views
Skip to first unread message

Ben Hines

unread,
Feb 8, 2017, 8:55:19 PM2/8/17
to Puppet Users
Perhaps this is just a bug, but does %{calling_class} function with Hiera 5? I haven't been able to get it to function.  Perhaps it has a new syntax?

Notice it's blank:

==> test:       Hierarchy entry "calling_class"
==> test:         Path "/tmp/vagrant-puppet/environments/myenv/data/classes/.yaml"
==> test:           Original path: "classes/%{calling_class}.yaml"
==> test:           Path not found


hiera.yaml looks like: (per the 'prerelease documention' :)


version: 5
hierarchy:
  - name: "calling_class"
    path: classes/%{calling_class}.yaml

defaults:
  datadir: data
  data_hash: yaml_data


-Ben

Henrik Lindberg

unread,
Feb 10, 2017, 4:39:27 PM2/10/17
to puppet...@googlegroups.com
On 08/02/17 17:55, Ben Hines wrote:
> Perhaps this is just a bug, but does %{calling_class} function with
> Hiera 5? I haven't been able to get it to function. Perhaps it has a
> new syntax?
>

It is deliberately not supported in the hiera 5 format.

- henrik

> Notice it's blank:
>
> ==> test: Hierarchy entry "calling_class"
> ==> test: Path
> "/tmp/vagrant-puppet/environments/myenv/data/classes/.yaml"
> ==> test: Original path: "classes/%{calling_class}.yaml"
> ==> test: Path not found
>
>
> hiera.yaml looks like: (per the 'prerelease documention' :)
>
>
> version: 5
> hierarchy:
> - name: "calling_class"
> path: classes/%{calling_class}.yaml
>
> defaults:
> datadir: data
> data_hash: yaml_data
>
>
> -Ben
>
> --
> 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
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/2083ae8f-5437-43c3-8c40-075c3b7abf57%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/2083ae8f-5437-43c3-8c40-075c3b7abf57%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Ben Hines

unread,
Feb 10, 2017, 5:10:53 PM2/10/17
to puppet...@googlegroups.com
Okay, thanks! From reading changelogs in git it looked like it was intended to be supported. It might be worth mentioning in the release notes.

Anyway in my case i can work around with module data.

thanks!

-Ben



--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/


--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/UYvmlCaOqLc/unsubscribe.
To unsubscribe from this group and all its topics, 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/8616db10-6e15-f71d-a999-c663d8d2bfe3%40puppet.com.

Henrik Lindberg

unread,
Feb 10, 2017, 8:59:25 PM2/10/17
to puppet...@googlegroups.com
On 10/02/17 14:10, Ben Hines wrote:
> Okay, thanks! From reading changelogs in git it looked like it was
> intended to be supported.

It is supported when using hiera.yaml version 3 as we must keep that
backwards compatible.

> It might be worth mentioning in the release notes.
>
yes, will make sure this gets to the docs folks.

> Anyway in my case i can work around with module data.
>

Excellent!

- henrik
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users%2Bunsu...@googlegroups.com>
> <mailto:puppet-users...@googlegroups.com
> <mailto:puppet-users%2Bunsu...@googlegroups.com>>.
> <https://groups.google.com/d/msgid/puppet-users/2083ae8f-5437-43c3-8c40-075c3b7abf57%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
>
>
> --
>
> Visit my Blog "Puppet on the Edge"
> http://puppet-on-the-edge.blogspot.se/
> <http://puppet-on-the-edge.blogspot.se/>
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/UYvmlCaOqLc/unsubscribe
> <https://groups.google.com/d/topic/puppet-users/UYvmlCaOqLc/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> puppet-users...@googlegroups.com
> <mailto:puppet-users%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/8616db10-6e15-f71d-a999-c663d8d2bfe3%40puppet.com
> <https://groups.google.com/d/msgid/puppet-users/8616db10-6e15-f71d-a999-c663d8d2bfe3%40puppet.com>.
>
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> 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
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CABGPr5m-s3MvwgrY-4yih4VSpMqnNq%3DcWnvW6EzJc2SRF%2BkGqw%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CABGPr5m-s3MvwgrY-4yih4VSpMqnNq%3DcWnvW6EzJc2SRF%2BkGqw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages