Cannot get a dictionary in custom facts

Hi,

As requested in https://github.com/ansible/ansible/issues/3737 I’m bringing this topic to the mailing list.

A simple custom facts module and an associated playbook https://gist.github.com/gnosek/6139435 end up with an empty dictionary, as seen in the debug output. If I run ansible-playbook with -v (or just call ansible host -m environment), I can see the nested dictionary returned correctly, just like with the default facts module (-m setup).

Any help appreciated.

Best regards,
Grzegorz Nosek

‘environment’ is a reserved key word in ansible
rename the name of that key in your hash to eg. ‘environment_’ and it will work.

Serge

W dniu 02.08.2013 15:21, Serge van Ginderachter pisze:

'environment' is a reserved key word in ansible
rename the name of that key in your hash to eg. 'environment_' and it
will work.

Yup, that did it. Thanks a lot!

Best regards,
  Grzegorz Nosek

Good catch Serge! why did I not remember that before! :slight_smile: