Hi,

always use quotes when using facts etc in hiera :

:hierarchy:
  - "%{operatingsystem}"
  - default

hth

Johan

On 30/07/14 18:21, Karolis Pabijanskas wrote:
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+unsubscr...@googlegroups.com <mailto:puppet-users+unsubscr...@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 <https://groups.google.com/d/msgid/puppet-users/CANYNSSKRx_p2ZpG2JjJLYhRKtwwgtB-AReVozpUsovAF7dPG_g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer              (805008667232363)
Puppet Certified Professional 2013/2014 (PCP0000006)
_________________________________________________________
Open-Future Phone +32 (0)2/255 70 70
Zavelstraat 72              Fax       +32 (0)2/255 70 71
3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
BELGIUM                     http://www.open-future.be
_________________________________________________________

Next Events:
Linux Training | https://www.open-future.be/linux-training-8-till-12th-september
Puppet Introduction Course | 
https://www.open-future.be/puppet-introduction-course-15th-september
Puppet Fundamentals Training | https://www.open-future.be/puppet-fundamentals-training-16-till-18th-september Zabbix Certified Specialist | https://www.open-future.be/zabbix-certified-specialisttraining-22-till-24th-september
Zabbix Certified Professional | 
https://www.open-future.be/zabbix-certified-professional-training-25-till-26th-september
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/53D92A23.4020201%40open-future.be.
For more options, visit https://groups.google.com/d/optout.

Reply via email to