Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'stdout'"} #39

Open
yctn opened this issue Sep 10, 2019 · 0 comments

Comments

@yctn
Copy link

yctn commented Sep 10, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant