How do I exit Ansible play without error on a condition

前端 未结 6 1648
我在风中等你
我在风中等你 2021-01-31 02:02

I want to exit without an error (I know about assert and fail modules) when I meet a certain condition. The following code exits but with a failure:

  tasks:

           


        
6条回答
  •  一整个雨季
    2021-01-31 02:37

    You can do this making assert condition false

    - name: WE ARE DONE. EXITING
      assert:
        that:
          - "'test' in 'stop'
    

提交回复
热议问题