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")
TASK [debug]
*******************************************************************************************************************************************
ok: [rchadm01] => {
"open_shares_info": "no_share"
}
TASK [debug]
*******************************************************************************************************************************************
ok: [rchadm01] => {
"linked_dirs_list": "no_share"
}
TASK [debug]
*******************************************************************************************************************************************
ok: [rchadm01] => {
"nfs_hard_mounts": "no_share"
}
TASK [Fail Playbook Execution]
*************************************************************************************************************************
fatal: [rchadm01]: FAILED! => {"changed": false, "msg": "Make sure to
unshare/unmount all NFS shares in NFS clients"}
--
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/b2532dc8-4fc8-4d74-8fd3-b8ac56f0f5d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.