community / community.network / 1.3.1 / module / edgeswitch_vlan Manage VLANs on Ubiquiti Edgeswitch network devices Authors: Frederic Bor (@f-bor)community.network.edgeswitch_vlan (1.3.1) — module
Install with ansible-galaxy collection install community.network:==1.3.1
collections: - name: community.network version: 1.3.1
This module provides declarative management of VLANs on Ubiquiti Edgeswitch network devices.
- name: Create vlan community.network.edgeswitch_vlan: vlan_id: 100 name: voice action: present
- name: Add interfaces to VLAN community.network.edgeswitch_vlan: vlan_id: 100 tagged_interfaces: - 0/1 - 0/4-0/6
- name: Setup three vlans and delete the rest community.network.edgeswitch_vlan: purge: true aggregate: - { vlan_id: 1, name: default, auto_untag: true, excluded_interfaces: 0/45-0/48 } - { vlan_id: 100, name: voice, auto_tag: true } - { vlan_id: 200, name: video, auto_exclude: true, untagged_interfaces: 0/45-0/48, tagged_interfaces: 0/49 }
- name: Delete vlan community.network.edgeswitch_vlan: vlan_id: 100 state: absent
name: description: - Name of the VLAN. purge: default: false description: - Purge VLANs not defined in the I(aggregate) parameter. type: bool state: choices: - present - absent default: present description: - action on the VLAN configuration. vlan_id: description: - ID of the VLAN. Range 1-4093. auto_tag: description: - Each of the switch interfaces will be set to accept and transmit untagged frames for I(vlan_id) unless defined in I(*_interfaces). This is a default setting for all switch interfaces. type: bool aggregate: description: List of VLANs definitions. auto_untag: description: - Each of the switch interfaces will be set to accept untagged frames and transmit them tagged for I(vlan_id) unless defined in I(*_interfaces). This is a default setting for all switch interfaces. type: bool auto_exclude: description: - Each of the switch interfaces will be excluded from I(vlan_id) unless defined in I(*_interfaces). This is a default setting for all switch interfaces. type: bool tagged_interfaces: description: - List of interfaces that should accept and transmit tagged frames for the VLAN. Accept range of interfaces. excluded_interfaces: description: - List of interfaces that should be excluded of the VLAN. Accept range of interfaces. untagged_interfaces: description: - List of interfaces that should accept untagged frames and transmit them tagged for the VLAN. Accept range of interfaces.
commands: description: The list of configuration mode commands to send to the device returned: always sample: - vlan database - vlan 100 - vlan name 100 "test vlan" - exit - interface 0/1 - vlan pvid 50 - vlan participation include 50,100 - vlan tagging 100 - vlan participation exclude 200 - no vlan tagging 200 type: list