W3cubDocs

/Ansible

ce_dldp - Manages global DLDP configuration on HUAWEI CloudEngine switches.

New in version 2.4.

Synopsis

  • Manages global DLDP configuration on HUAWEI CloudEngine switches.

Options

parameter required default choices comments
auth_mode
no
  • md5
  • simple
  • sha
  • hmac-sha256
  • none
Specifies authentication algorithm of DLDP.
auth_pwd
no
Specifies authentication password. The value is a string of 1 to 16 case-sensitive plaintexts or 24/32/48/108/128 case-sensitive encrypted characters. The string excludes a question mark (?).
enable
no
  • enable
  • disable
Set global DLDP enable state.
reset
no
  • enable
  • disable
Specify whether reset DLDP state of disabled interfaces.
time_internal
no
Specifies the interval for sending Advertisement packets. The value is an integer ranging from 1 to 100, in seconds. The default interval for sending Advertisement packets is 5 seconds.
work_mode
no
  • enhance
  • normal
Set global DLDP work-mode.

Examples

- name: DLDP 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: "Configure global DLDP enable state"
    ce_dldp:
      enable: enable
      provider: "{{ cli }}"

  - name: "Configure DLDP work-mode and ensure global DLDP state is already enabled"
    ce_dldp:
      enable: enable
      work_mode: normal
      provider: "{{ cli }}"

  - name: "Configure advertisement message time interval in seconds and ensure global DLDP state is already enabled"
    ce_dldp:
      enable: enable
      time_interval: 6
      provider: "{{ cli }}"

  - name: "Configure a DLDP authentication mode and ensure global DLDP state is already enabled"
    ce_dldp:
      enable: enable
      auth_mode: md5
      auth_pwd: abc
      provider: "{{ cli }}"

  - name: "Reset DLDP state of disabled interfaces and ensure global DLDP state is already enabled"
    ce_dldp:
      enable: enable
      reset: enable
      provider: "{{ cli }}"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
end_state
k/v pairs of global DLDP configration after module execution
always dict {'reset': 'enable', 'time_internal': '12', 'enable': 'enable', 'work_mode': 'normal'}
changed
check to see if a change was made on the device
always boolean True
updates
command sent to the device
always list ['dldp enable', 'dldp work-mode normal', 'dldp interval 12', 'dldp reset']
proposed
k/v pairs of parameters passed into module
always dict {'reset': 'enable', 'time_internal': '12', 'enable': 'enable', 'work_mode': 'normal'}
existing
k/v pairs of existing global DLDP configration
always dict {'reset': 'disable', 'time_internal': '5', 'enable': 'disable', 'work_mode': 'enhance'}

Notes

Note

  • The relevant configurations will be deleted if DLDP is disabled using enable=disable.
  • When using auth_mode=none, it will restore the default DLDP authentication mode. By default, DLDP packets are not authenticated.
  • By default, the working mode of DLDP is enhance, so you are advised to use work_mode=enhance to restore defualt DLDP working mode.
  • The default interval for sending Advertisement packets is 5 seconds, so you are advised to use time_interval=5 to restore defualt DLDP interval.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/ce_dldp_module.html