- Posted In
- Red Hat Ansible Engine
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.rc != 0 #when: stat_reboot.rc == 0 #when: stat_reboot is failed #when: '"Reboot" in reboot.stdout' #when: reboot.stdout.stdout == "Reboot"