New in version 2.8.
Parameter | Choices/Defaults | Comments |
---|---|---|
aggregate - | List of VLANs definitions. | |
auto_exclude boolean |
| Each of the switch interfaces will be excluded from vlan_id unless defined in *_interfaces. This is a default setting for all switch interfaces. |
auto_tag boolean |
| Each of the switch interfaces will be set to accept and transmit untagged frames for vlan_id unless defined in *_interfaces. This is a default setting for all switch interfaces. |
auto_untag boolean |
| Each of the switch interfaces will be set to accept untagged frames and transmit them tagged for vlan_id unless defined in *_interfaces. This is a default setting for all switch interfaces. |
excluded_interfaces - | List of interfaces that should be excluded of the VLAN. Accept range of interfaces. | |
name - | Name of the VLAN. | |
purge boolean |
| Purge VLANs not defined in the aggregate parameter. |
state - |
| action on the VLAN configuration. |
tagged_interfaces - | List of interfaces that should accept and transmit tagged frames for the VLAN. Accept range of interfaces. | |
untagged_interfaces - | List of interfaces that should accept untagged frames and transmit them tagged for the VLAN. Accept range of interfaces. | |
vlan_id - | ID of the VLAN. Range 1-4093. |
Note
- 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
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
commands list | always | The list of configuration mode commands to send to the device 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'] |
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/edgeswitch_vlan_module.html