ansible / ansible.builtin / v2.8.19 / module / edgeswitch_vlan Manage VLANs on Ubiquiti Edgeswitch network devices | "added in version" 2.8 of ansible.builtin" Authors: Frederic Bor (@f-bor) preview | supported by communityansible.builtin.edgeswitch_vlan (v2.8.19) — module
pip
Install with pip install ansible==2.8.19
This module provides declarative management of VLANs on Ubiquiti Edgeswitch network devices.
- name: Create vlan edgeswitch_vlan: vlan_id: 100 name: voice action: present
- name: Add interfaces to VLAN edgeswitch_vlan: vlan_id: 100 tagged_interfaces: - 0/1 - 0/4-0/6
- name: setup three vlans and delete the rest 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 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