I'm trying to write a conditional to only act on members of a list of
strings when two characters in the string are less than a given number.
Does anyone know if this is possible? What I'm trying now looks like:
set_fact:
interfaces:
- TenGigabitEthernet 0/32
- TenGigabitEthernet 0/33
debug: var={{ interfaces }}
loop: "{{ facts }}"
when: item[21:22]|int <= 32
When I attempt this, I get, "template error while templating string:
expected token 'end of print statement', got 'integer'. String:
{{TenGigabitEthernet 0/32}}"
Any thoughts how how to achieve this are appreciated.
Thanks,
Jameson
--
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/CAHtGYf8Aex19_9BCLo-vqsqCxb7QTYb%3D6myjK%3DUzRR%3Df1YrtcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.