How to retry Ansible task that may fail?

前端 未结 4 1768
[愿得一人]
[愿得一人] 2020-12-29 18:26

In my Ansible play I am restarting database then trying to do some operations on it. Restart command returns as soon as restart is started, not when db is up. Next command t

4条回答
  •  生来不讨喜
    2020-12-29 19:16

    Not sure if this is Ansible tower specific, but I am using:

    - command: /usr/bin/false
      register: result
      retries: 3
      delay: 10
      until: result is not failed
    

提交回复
热议问题