when i run ansible with a script it will return the following error: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'stdout'"}
i think its issue is further described here:
https://www.middlewareinventory.com/blog/ansible-dict-object-has-no-attribute-stdout-or-stderr-how-to-resolve/
we fixed it the following way:
- when: service_mgr | default(ansible_service_mgr) == 'upstart'
- when: service_mgr | default(ansible_service_mgr) == 'upstart' and not ansible_check_mode
/etc/init/prometheus-node-exporter.conf depends on the output of a variable which is set in a previous task. But, in --check mode (dry run) this command is never executed and that rendering of this template fails. So, the fix is here to do not process this template when running in ansible_check_mode.
but maby you would like to fix it another way.
when i run ansible with a script it will return the following error: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'stdout'"}
i think its issue is further described here:
https://www.middlewareinventory.com/blog/ansible-dict-object-has-no-attribute-stdout-or-stderr-how-to-resolve/
we fixed it the following way:
/etc/init/prometheus-node-exporter.conf depends on the output of a variable which is set in a previous task. But, in --check mode (dry run) this command is never executed and that rendering of this template fails. So, the fix is here to do not process this template when running in ansible_check_mode.
but maby you would like to fix it another way.