community.network.ce_vlan module – Manages VLAN resources and attributes on Huawei CloudEngine switches.
Note
This module is part of the community.network collection (version 5.1.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.network.
To use it in a playbook, specify: community.network.ce_vlan.
Note
The community.network collection has been deprecated and will be removed from Ansible 12. See the discussion thread for more information.
DEPRECATED
- Removed in:
- version 6.0.0 
- Why:
- This collection and all content in it is unmaintained and deprecated. 
- Alternative:
- Unknown. 
Synopsis
- Manages VLAN configurations on Huawei CloudEngine switches. 
Aliases: network.cloudengine.ce_vlan
Parameters
| Parameter | Comments | 
|---|---|
| Specify VLAN description, minimum of 1 character, maximum of 80 characters. | |
| Name of VLAN, minimum of 1 character, maximum of 31 characters. | |
| Manage the state of the resource. Choices: 
 | |
| Single VLAN ID, in the range from 1 to 4094. | |
| Range of VLANs such as  | 
Notes
Note
- This module requires the netconf system service be enabled on the remote device being managed. 
- Recommended connection is - netconf.
- This module also works with - localconnections for legacy playbooks.
Examples
- name: Vlan module test
  hosts: cloudengine
  connection: local
  gather_facts: false
  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
    community.network.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
    community.network.ce_vlan:
      vlan_id: 50
      name: WEB
      state: absent
      provider: "{{ cli }}"
  - name: Ensure VLAN is NOT on the device
    community.network.ce_vlan:
      vlan_id: 50
      state: absent
      provider: "{{ cli }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Description | 
|---|---|
| check to see if a change was made on the device Returned: always Sample:  | |
| k/v pairs of the VLAN after executing module or null when using vlan_range Returned: always Sample:  | |
| list of VLANs after the module is executed Returned: always Sample:  | |
| k/v pairs of existing vlan or null when using vlan_range Returned: always Sample:  | |
| list of existing VLANs on the switch prior to making changes Returned: always Sample:  | |
| k/v pairs of parameters passed into module (does not include vlan_id or vlan_range) Returned: always Sample:  | |
| list of VLANs being proposed Returned: always Sample:  | |
| command string sent to the device Returned: always Sample:  | 
Status
- This module will be removed in version 6.0.0. [deprecated] 
- For more information see DEPRECATED. 
