Le 2018-08-23 17:10, Jameson a écrit :
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

Hi,

Does'nt sound good... Explain a little bit what you want if you want some good help.

To be able to test item against an integer, use something like this (not tested, but you should have the idea)
item|regex_replace('^.* 0/','')|int

Regards,

JYL

--
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/223b45b96b9b4dd89f148ebdd151d439%40lenhof.eu.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to