Conditions with vlan id

Hi Team,

I need to push the line in cisco switch if vlan id =25 or vlan id = 100-119. what module should I use?

I parsed show interfaces status and got below structured output. please help.

“Gi1/0/12”: {
“data”: {
“duplex”: “auto”,
“interface”: “Gi1/0/12”,
“name”: “test interface”,
“speed”: “auto”,
“status”: “notconnect”,
“type”: " 10/100/1000BaseTX",
“vlan”: “25”

thanks

This got resolved. thanks team.

Thanks, but I don't see the answer in this thread?
How was it solved?

The below is the solution

vlan_id_l2 : [‘30’, ‘100’]

  • name: configure the line based on desired condition (Layer 2)
    ios_config:
    lines:



parents: “interface {{ item.key }}”
when: item.value.data.vlan in vlan_id_l2
with_dict: “{{ interfaces_status_facts }}”