Karolis Pabijanskas
2014-Jul-30 16:21 UTC
[Puppet Users] Hiera not expanding $operatingsystem variable
Hi All, I am sure this is going to be something completely stupid, but I just can't find the issue :) I have a very simple module that that needs a different filepath depending on the operating system, so I'm trying to call: $global_bashrc_file = hiera("global_bashrc_file") from my module. The hierarchy at the moment is very simple: :hierarchy: - %{operatingsystem} - default Calling notify from the module works just fine and brings back CentOS as my operating system. CentOS.yaml does exist in the datadir and does contain the variable. Running hiera in through the shell does indeed show it working and returns the correct variable: # hiera global_bashrc_file operatingsystem=CentOS /etc/bashrc But when trying to get this value via puppet, I just get an error: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item global_bashrc_file in any Hiera data file and no default supplied at blah It does work perfectly fine if I place the variable in default.yaml, but if I move it to the os-specific yaml it just shouts at me that I have not declared it... Just seems like $operatingsystem does not get passed on from puppet, even though: # facter operatingsystem CentOS and notify '{ "${operatingsystem": }' in puppet works. As mentioned, I am sure I am missing something very trivial, but maybe one of you enlightened ones can point me in the right direction! puppet version is 3.6.2 hiera version i 1.3.4 Thanks in advance! Karolis -- 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+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CANYNSSKRx_p2ZpG2JjJLYhRKtwwgtB-AReVozpUsovAF7dPG_g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.