hiera calling_class files fail with yaml provider on Windows

198 views
Skip to first unread message

Ben Hines

unread,
Jan 13, 2014, 4:47:42 PM1/13/14
to puppet...@googlegroups.com
Howdy,

My organization has a pre-existing hiera configuration which uses {calling_class}.yaml configuration files, like:

classes/base::openldap.yaml

Which get pulled into hiera via this path in the hierarchy.

:hierarchy:
...
  - "%{environment}/classes/%{calling_class}"

This does not work on Windows. Windows does not support colons in filenames so the .yaml can't even be checked out from source control. This presents issues when developing our puppet manifests on windows and sharing them with a Vagrant VM, for example.

It'd be really nice if hiera supported reading calling_class files from files which did not use colons as separators. Perhaps it could look up the class via a 'backup' parameter if the colon version does not exist? (and it'd have to do this on every OS.. since the problem is a directory which is checked out on both windows and linux.. perhaps could be an option?)

As a workaround i was considering implementing a custom Hiera backend, but i'm not sure if there is an easier method.

Thanks
-Ben

Felix Frank

unread,
Jan 19, 2014, 8:50:19 PM1/19/14
to puppet...@googlegroups.com
Hi,

that's what sprang to my mind, too, when I read your problem description.

From experience, it can be a little daunting to override certain parts
of hiera functionality in a custom backend. You may find yourself using
some copy-paste because some methods live on the module level and cannot
be overridden directly.

HTH,
Felix

Rob Reynolds

unread,
Jan 21, 2014, 1:17:29 PM1/21/14
to puppet...@googlegroups.com
On Mon, Jan 13, 2014 at 3:47 PM, Ben Hines <bhi...@gmail.com> wrote:
Howdy,

My organization has a pre-existing hiera configuration which uses {calling_class}.yaml configuration files, like:

classes/base::openldap.yaml

Which get pulled into hiera via this path in the hierarchy.

:hierarchy:
...
  - "%{environment}/classes/%{calling_class}"

This does not work on Windows. Windows does not support colons in filenames so the .yaml can't even be checked out from source control. This presents issues when developing our puppet manifests on windows and sharing them with a Vagrant VM, for example.

It'd be really nice if hiera supported reading calling_class files from files which did not use colons as separators. Perhaps it could look up the class via a 'backup' parameter if the colon version does not exist? (and it'd have to do this on every OS.. since the problem is a directory which is checked out on both windows and linux.. perhaps could be an option?)

Would you mind filing an issue for this so we can prioritize it? https://tickets.puppetlabs.com/browse/HI
 

As a workaround i was considering implementing a custom Hiera backend, but i'm not sure if there is an easier method.

Thanks
-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.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/92780abb-f43b-4ac7-a339-657fd503e562%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Rob Reynolds
Developer, Puppet Labs

Join us at PuppetConf 2014September 23-24 in San Francisco - http://bit.ly/pupconf14
Register now and save 40%! Offer expires January 31st.

Reply all
Reply to author
Forward
0 new messages