On Tue, Aug 11, 2020 at 3:51 PM Spiro Mitsialis <[email protected]> wrote: > > Using various methods, I can get a list of VLAN on a switch port. The list > looks like the following: > "vlans": > "1,134,170,175,540,605,819-820,911-912,930-932,945,952,955,959-960,1200-1201,1400" > > I would like to check to see if VLAN 931 is in the list. In this case its > between 930-932 in the list. Is there a filter or function that I can use to > see if its in the list? > Is there some other way I can get this info? > > For a single VLAN number I can use when: 'item in vlans" if in a loop but > 'in" looks for exact match. > It is probably happening because your switch does not return a nice list. 911-912 is a single entry in your list. I would first convert entries like 930-932 into 930,931,932.
> -- > 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/7fbfa960-ecea-46a7-b3b1-660f56f912dbo%40googlegroups.com. -- 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/CAHEKYV7L5Gs6x-ykPKXS0XniYcfHaGnGQETDkB9jSqwmjiPSdg%40mail.gmail.com.
