Hi,
I'm a beginner with PHP but I managed to get two scripts to work for generating external facts for a puppet module. These scripts work perfectly when I run puppet manually (puppet agent --test), but when the puppet agent is started as a daemon (systmctl start puppet), facts are not generated. Both scripts give the same error:
start-puppet-agent: Fact file /var/lib/puppet/facts.d/get_extensions_details.php was parsed but returned an empty data set
start-puppet-agent: Fact file /var/lib/puppet/facts.d/get_directives_details.php was parsed but returned an empty data set
I wonder what kind of difference could cause that.
I tried debugging as much as I can, but it looks like the array $arr is not fed by the json_decode function. I think json support is built-in so the php config should not matter. PHP throws this error:
invalid argument supplied for foreach()
Scripts:
https://github.com/zend-patterns/ZendServerPuppet/blob/master/facts.d/get_directives_details.phphttps://github.com/zend-patterns/ZendServerPuppet/blob/master/facts.d/get_extensions_details.php(still) running puppet 3
Thanks,