I notice that some modules use ‘module.debug’ for logging, but I can’t find any docs on it. I skimmed the function definition in AnsibleModule and it appears that when the module has the _debug attribute set, it tries to log to syslog. I’m trying to get this to work in ansible-test, but I can’t make it happen, even when I pass --debug in. How does this feature work?
short answer: ANSIBLE_DEBUG=1 activates it
long answer:
This is integrated into AnsibleModule
(lib/ansible/module_utils/basic.py), which has a 'debug' method, this
method will write to the local syslog/systemd.
The method is activated when the module receives an `_ansible_debug`
parameter that is True, which ansible itself sends if 'debug is
enabled' via the configuration (env var above or in ansible.cfg).
It will turn off if you use no_log or have the no_target_syslog
setting to avoid disclosure.
I hope that helps
That’s very helpful, thanks!