Hi, wondering if there is any cleaner way to see if two lists have 1 or
more intersecting values?
the following works for me
# returns true
> {{ ['value1', 'value2'] | intersect(['value1', 'value2']) | length > 0 }}
> # returns false
> {{ ['value3', 'value4'] | intersect(['value1', 'value2']) | length > 0 }}
just wondering if there is a cleaner looking solution that I am not aware
of as I am using it frequently.
something like would be handy.
> {{ ['value1', 'value2].any(['value1', 'value2']) }}
--
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/ac91665d-1ad3-4099-84df-e6b5513e16b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.