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.   


Thanks

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5cd0d61d-8f89-41db-998b-3b6168fc7072n%40googlegroups.com.

Reply via email to