I apologize, guys. There were some typeos in my example. This isn't the
actual code I'm using because I tried to simplify the example to only
include the problem I'm having. This is a copy of the playbook that
includes on this scenario. Obviously, production playbook I'm putting this
in will have the variable for the interfaces pulled from the device:

---
- hosts: "{{ target }}"
  connection: network_cli
  gather_facts: no
  tasks:

  - set_fact:
      interfaces:
        - TenGigabitEthernet 0/32
        - TenGigabitEthernet 0/33

  - debug: var={{ item }}
    loop: "{{ interfaces }}"
    when: item[21:]|int <= 32

My goal is to have this only output the first string in the list of
interfaces as it is equal to or less than 32. In production, this will be a
much larger list, and I will have other filters, so that it only includes
my 10 gig interfaces, but the rest of it is already working for me. 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 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/CAHtGYf_m7SQfbOBBN930beTGEcek8grZpgw33jWw8QD8W6HVTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to