you can also use "assert" and the execution stops right there and it will 
not execute any tasks further

On Tuesday, February 14, 2017 at 8:43:30 AM UTC-8, bablu wrote:
>
>
>  If condition fails it should not go for the next step and exit from there 
> only. 
>
>  In following situation,  when: C != test_val    it should exit from here 
> only instead of going to the next step. How can i achieve this.
>
>
>    - name: Set the output of the this state
>      set_fact: A="{{image_avl.stdout}}"          
>      tags: avl1
>
>    - name: Define our static value for the desired image number
>      set_fact: B={{retain}}                      
>      tags: num2
>
>    - name: difference
>      set_fact: C = {{A}} - {{B}}  
>      tags: del1
>
>    - name: set the desire value   
>      set_fact: test_val=1
>      tags: fact2  
>
>    - name: condition1 
>      action: sending email here 
>      when: C != test_val
>      tags: message 
>  
>    - name: condition2
>   
>    - name: condition3
>   
>    
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/758a644e-8922-4e1e-a709-9a8fb159fc15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to