Why is $facts is not a hash or array when accessing it
I get the following error:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: $facts["nrpe_plugins"] is not a hash or array when accessing it with CheckSystemErrors at /etc/puppet/environments/development/modules/site_custom/manifests/nagios_nrpe_plugin.pp:27 on node test.example.com
The line of code that throws this is
if( !$facts['nrpe_plugins'] or ! $facts['nrpe_plugins']["$plugin_name"]) ...
So I access the $facts hash as described on puppetlabs doc
I have a puppet master that is newer than 3.5
[root@puppet]# puppet master --version 3.6.2
and I have configured the master to use (and trust) the client facts:
[root@iipc-unet02 puppet]# puppet config print --section master | grep "string\|trust" ldapstring = (&(objectclass=puppetClient)(cn=%s)) trusted_node_data = true stringify_facts = false
I am using puppet community edition
I thought I finally found the culprit. I had the config parameter immutablenodedata set to true.
It was in the doc . Now I changed it to false but now it looks like no fact is set at all. (My facts are on the agent node in /etc/facter/facts.d/nagiosnrpeplugins.yaml and I can see them using facter).
However in a puppet run it looks like they are not sent to the master.