�
�Udac @` s: d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l Z d d l m
Z
d d
l m Z d d l m Z d d l m Z m Z m Z d d l m Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e! d k r6e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont
deprecatedt statust networkt supported_bys�
---
module: ios_vlan
version_added: "2.5"
author: "Trishna Guha (@trishnaguha)"
short_description: Manage VLANs on IOS network devices
description:
- This module provides declarative management of VLANs
on Cisco IOS network devices.
deprecated:
removed_in: '2.13'
alternative: ios_vlans
why: Newer and updated modules released with more functionality in Ansible 2.9
notes:
- Tested against IOS 15.2
options:
name:
description:
- Name of the VLAN.
vlan_id:
description:
- ID of the VLAN. Range 1-4094.
required: true
interfaces:
description:
- List of interfaces that should be associated to the VLAN.
required: true
associated_interfaces:
description:
- This is a intent option and checks the operational state of the for given vlan C(name)
for associated interfaces. If the value in the C(associated_interfaces) does not match with
the operational state of vlan interfaces on device it will result in failure.
version_added: "2.5"
delay:
description:
- Delay the play should wait to check for declarative intent params values.
default: 10
aggregate:
description: List of VLANs definitions.
purge:
description:
- Purge VLANs not defined in the I(aggregate) parameter.
default: no
type: bool
state:
description:
- State of the VLAN configuration.
default: present
choices: ['present', 'absent', 'active', 'suspend']
extends_documentation_fragment: ios
sM
- name: Create vlan
ios_vlan:
vlan_id: 100
name: test-vlan
state: present
- name: Add interfaces to VLAN
ios_vlan:
vlan_id: 100
interfaces:
- GigabitEthernet0/0
- GigabitEthernet0/1
- name: Check if interfaces is assigned to VLAN
ios_vlan:
vlan_id: 100
associated_interfaces:
- GigabitEthernet0/0
- GigabitEthernet0/1
- name: Delete vlan
ios_vlan:
vlan_id: 100
state: absent
- name: Add vlan using aggregate
ios_vlan:
aggregate:
- { vlan_id: 100, name: test-vlan, interfaces: [GigabitEthernet0/1, GigabitEthernet0/2], delay: 15, state: suspend }
- { vlan_id: 101, name: test-vlan, interfaces: GigabitEthernet0/3 }
- name: Move interfaces to a different VLAN
ios_vlan:
vlan_id: 102
interfaces:
- GigabitEthernet0/0
- GigabitEthernet0/1
s�
commands:
description: The list of configuration mode commands to send to the device
returned: always
type: list
sample:
- vlan 100
- name test-vlan
N( t deepcopy( t
AnsibleModule( t remove_default_spec( t load_configt run_commandst normalize_interface( t ios_argument_specc C` s) x"