Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • 'dict object' has no attribute 'stdout'

    Posted on

    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"
    

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2025 Red Hat