> ...
> vars:
> ips: [1.1.1.1,2.2.2.2]
If tacacs.stdout.0 is a list (not very likely) try this
when: ips|intersect(tacacs.stdout.0)|length > 0
> when: ("'1.1.1.1' in tacacs.stdout[0]") or
> ("'2.2.2.2' in tacacs.stdout[0]")
If tacacs.stdout.0 is a text (more likely) try this
when: tacacs.stdout.0 is search(ips.0|regex_escape()) or
tacacs.stdout.0 is search(ips.1|regex_escape())
> when tacacs.stdout[0] contains ips
There is no *contains* test in Ansible but you can write one
https://github.com/vbotka/ansible-plugins/blob/master/test_plugins/list.py
If tacacs.stdout.0 is a text with IP value only the previous
solution should work. Or, with the custom test, try this
when: ips contains(tacacs.stdout.0)
--
Vladimir Botka