community.network.ce_dldp_interface module – Manages interface DLDP configuration on HUAWEI CloudEngine switches.
Note
This module is part of the community.network collection (version 5.0.2).
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_dldp_interface
.
Synopsis
Manages interface DLDP configuration on HUAWEI CloudEngine switches.
Aliases: network.cloudengine.ce_dldp_interface
Parameters
Parameter |
Comments |
---|---|
Set interface DLDP enable state. Choices:
|
|
Must be fully qualified interface name, i.e. GE1/0/1, 10GE1/0/1, 40GE1/0/22, 100GE1/0/1. |
|
Set the source MAC address for DLDP packets sent in the DLDP-compatible mode. The value of MAC address is in H-H-H format. H contains 1 to 4 hexadecimal digits. |
|
Set DLDP compatible-mode enable state. Choices:
|
|
Specify whether reseting interface DLDP state. Choices:
|
|
Manage the state of the resource. Choices:
|
Notes
Note
If
state=present, enable=disable
, interface DLDP enable will be turned off and related interface DLDP configuration will be cleared.If
state=absent
, only local_mac is supported to configure.This module requires the netconf system service be enabled on the remote device being managed.
Recommended connection is
netconf
.This module also works with
local
connections for legacy playbooks.
Examples
- name: DLDP interface 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: "Configure interface DLDP enable state and ensure global dldp enable is turned on"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
provider: "{{ cli }}"
- name: "Configuire interface DLDP compatible-mode enable state and ensure interface DLDP state is already enabled"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
mode_enable: enable
provider: "{{ cli }}"
- name: "Configuire the source MAC address for DLDP packets sent in the DLDP-compatible mode and
ensure interface DLDP state and compatible-mode enable state is already enabled"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
mode_enable: enable
local_mac: aa-aa-aa
provider: "{{ cli }}"
- name: "Reset DLDP state of specified interface and ensure interface DLDP state is already enabled"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
enable: enable
reset: enable
provider: "{{ cli }}"
- name: "Unconfigure interface DLDP local mac address when C(state=absent)"
community.network.ce_dldp_interface:
interface: 40GE2/0/1
state: absent
local_mac: aa-aa-aa
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 interface DLDP configuration after module execution Returned: always Sample: |
|
k/v pairs of existing interface DLDP configuration Returned: always Sample: |
|
k/v pairs of parameters passed into module Returned: always Sample: |
|
command sent to the device Returned: always Sample: |