'dict object' has no attribute 'stdout'

Latest response

Hello guys,

I am unable to use when condition in ansible playbook. I tried different methods to input the value from the previous to "when" condition but nothing worked. I am using the ansible version 2.6.20. I have used below conditions in the reboot task, but always failing at this condition with error "'dict object' has no attribute 'stdout". Please advise if you have any fix for this.

#when: stat_reboot.results[0].rc != 0
#when: stat_reboot.rc == 0
#when: stat_reboot is failed
#when: '"Reboot" in reboot.stdout'
#when: reboot.stdout.stdout == "Reboot"



Can this issue reproduce on latest version Ansible v 2.9.11 ?

Regards Ju