Hello,
I have items defined with with_items in ansible task and that item is not existing in the group_vars/all file so it should be skipped. But it is matching to the substring of a string in the group_vars file.
e.g. I have the below task:
task:
when: “item in variable”
with_items:
- dash
- lg
group_vars/all file has below list:
variable: |
[
“abc-dash”,
‘def-dash’
]
I don’t want the item (dash) should match to abc_dash and def_dash. currently, it is matching to both and it is not being skipped. I already tried quoting the item(dash) with single and double quotes but did not work. How can I implement this so that item dash can be skipped?