On 06.02.17 20:00 DHAVAL JAISWAL wrote:
> Tried below one. However, when condition is not correctly evaluating.

Please show the exact error message. Or the exact output, maybe with -v.

>   tasks:
>    - name: Get the state of the Test version
>      shell: alert1=`cat /tmp/test.log |  grep -e "pending" -e "failed" | wc
> -l`;
>      register: image_state
>      tags: image

Add a debug task here (with correct indentation):
- debug: var="image_state"

>      set_fact: current_image_state=image_state.stdout

I guess here is your error. You set the variable current_image_state
to a text string called "image_state.stdout". Add double curly braces
and quotes:

set_fact: current_image_state="{{ image_state.stdout }}"

>    - name: Define our static value for the desired Test state
>      set_fact: desire_image_state=0

I am not sure if thus sets desire_image_state to an integer or a string.

Johannes

-- 
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/a2cc1eed-2958-d0a6-f1f1-f7b8eec90a60%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to