Skip to content

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

@yctn

Description

@yctn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions