Hopefully someone can assist - this seems like it should be a simple thing.
vars:
ips: [1.1.1.1,2.2.2.2]
tasks:
-name: Get Tacacs info
cisco.ios.ios_command
commands: “show tacacs”
register: tacacas
-name: Run command based on tacacs var
cisco.ios.config:
lines:
do stuff
when tacacs.stdout[0] contains ips
which gives me a template error.
Also tried:
when: (“‘1.1.1.1’ in tacacs.stdout[0]”) or
(“‘2.2.2.2’ in tacacs.stdout[0]”)
this comes back true for all of the hosts regardless if the IPs are in the output or not.
My goal is to have to run the command when it finds 1.1.1.1 or 2.2.2.2 in the output. Any help would be appreciated.