ansible / ansible.builtin / v2.4.0.0-1 / module / ce_vlan Manages VLAN resources and attributes on Huawei CloudEngine switches. | "added in version" 2.4 of ansible.builtin" Authors: QijunPan (@CloudEngine-Ansible) preview | supported by communityansible.builtin.ce_vlan (v2.4.0.0-1) — module
pip
Install with pip install ansible==2.4.0.0.post1
Manages VLAN configurations on Huawei CloudEngine switches.
- name: vlan module test hosts: cloudengine connection: local gather_facts: no vars: cli: host: "{{ inventory_hostname }}" port: "{{ ansible_ssh_port }}" username: "{{ username }}" password: "{{ password }}" transport: cli tasks: - name: Ensure a range of VLANs are not present on the switch ce_vlan: vlan_range: "2-10,20,50,55-60,100-150" state: absent provider: "{{ cli }}" - name: Ensure VLAN 50 exists with the name WEB ce_vlan: vlan_id: 50 name: WEB state: absent provider: "{{ cli }}" - name: Ensure VLAN is NOT on the device ce_vlan: vlan_id: 50 state: absent provider: "{{ cli }}"
name: default: null description: - Name of VLAN, in the range from 1 to 31. required: false state: choices: - present - absent default: present description: - Manage the state of the resource. required: false vlan_id: default: null description: - Single VLAN ID, in the range from 1 to 4094. required: false vlan_range: default: null description: - Range of VLANs such as C(2-10) or C(2,5,10-15), etc. required: false description: default: null description: - Specify VLAN description, in the range from 1 to 80. required: false
changed: description: check to see if a change was made on the device returned: always sample: true type: boolean end_state: description: k/v pairs of the VLAN after executing module or null when using vlan_range returned: always sample: description: vlan for app name: VLAN_APP vlan_id: '20' type: dict end_state_vlans_list: description: list of VLANs after the module is executed returned: always sample: - '1' - '2' - '3' - '4' - '5' - '20' - '100' type: list existing: description: k/v pairs of existing vlan or null when using vlan_range returned: always sample: description: '' name: VLAN_APP vlan_id: '20' type: dict existing_vlans_list: description: list of existing VLANs on the switch prior to making changes returned: always sample: - '1' - '2' - '3' - '4' - '5' - '20' type: list proposed: description: k/v pairs of parameters passed into module (does not include vlan_id or vlan_range) returned: always sample: description: vlan for app name: VLAN_APP vlan_id: '20' type: dict proposed_vlans_list: description: list of VLANs being proposed returned: always sample: - '100' type: list updates: description: command string sent to the device returned: always sample: - vlan 20 - name VLAN20 type: list