On 28.02.2019 13:52, Pandu jh wrote:
> When Condition check is not working in a list as expected.
> 
> My requirement is
> 
> Playbook should not fail If all the three mentioned variables have
> "no_share" value.
> But it's failing not sure what causing this issue.
> 
> 
> 
>      - debug:  var=open_shares_info
>      - debug:  var=linked_dirs_list
>      - debug:  var=nfs_hard_mounts
> 
>      - name: Fail Playbook Execution
>        fail:
>          msg:  "Make sure to unshare/unmount all NFS shares in NFS clients"
>        when:  ("'no_share' not in open_shares_info") and  ("'no_share' not
> in linked_dirs_list") and and ("'no_share' not in nfs_hard_mounts")

In Jinja template that when uses, quotes, single and double, means this is a 
string.
So when you put a double quote around the hole expressing you are making it a 
sting.

In you when its

  a_string and a_string and a_string

Remove the double quotes and it should work. (and also remove the double and)


-- 
Kai Stian Olstad

-- 
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/fd641167-60f8-6fb7-a9b3-54b413c40110%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to