�
�Udac @ s� 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 m Z m
Z
m Z d Z d Z d � Z d e f d � � YZ d � Z e d k r� e � n d
S( s 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: ce_bfd_global
version_added: "2.4"
short_description: Manages BFD global configuration on HUAWEI CloudEngine devices.
description:
- Manages BFD global configuration on HUAWEI CloudEngine devices.
author: QijunPan (@QijunPan)
notes:
- This module requires the netconf system service be enabled on the remote device being managed.
- Recommended connection is C(netconf).
- This module also works with C(local) connections for legacy playbooks.
options:
bfd_enable:
description:
- Enables the global Bidirectional Forwarding Detection (BFD) function.
choices: ['enable', 'disable']
default_ip:
description:
- Specifies the default multicast IP address.
The value ranges from 224.0.0.107 to 224.0.0.250.
tos_exp_dynamic:
description:
- Indicates the priority of BFD control packets for dynamic BFD sessions.
The value is an integer ranging from 0 to 7.
The default priority is 7, which is the highest priority of BFD control packets.
tos_exp_static:
description:
- Indicates the priority of BFD control packets for static BFD sessions.
The value is an integer ranging from 0 to 7.
The default priority is 7, which is the highest priority of BFD control packets.
damp_init_wait_time:
description:
- Specifies an initial flapping suppression time for a BFD session.
The value is an integer ranging from 1 to 3600000, in milliseconds.
The default value is 2000.
damp_max_wait_time:
description:
- Specifies a maximum flapping suppression time for a BFD session.
The value is an integer ranging from 1 to 3600000, in milliseconds.
The default value is 15000.
damp_second_wait_time:
description:
- Specifies a secondary flapping suppression time for a BFD session.
The value is an integer ranging from 1 to 3600000, in milliseconds.
The default value is 5000.
delay_up_time:
description:
- Specifies the delay before a BFD session becomes Up.
The value is an integer ranging from 1 to 600, in seconds.
The default value is 0, indicating that a BFD session immediately becomes Up.
state:
description:
- Determines whether the config should be present or not on the device.
default: present
choices: ['present', 'absent']
s�
- name: bfd global 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: Enable the global BFD function
ce_bfd_global:
bfd_enable: enable
provider: '{{ cli }}'
- name: Set the default multicast IP address to 224.0.0.150
ce_bfd_global:
bfd_enable: enable
default_ip: 224.0.0.150
state: present
provider: '{{ cli }}'
- name: Set the priority of BFD control packets for dynamic and static BFD sessions
ce_bfd_global:
bfd_enable: enable
tos_exp_dynamic: 5
tos_exp_static: 6
state: present
provider: '{{ cli }}'
- name: Disable the global BFD function
ce_bfd_global:
bfd_enable: disable
provider: '{{ cli }}'
s
proposed:
description: k/v pairs of parameters passed into module
returned: verbose mode
type: dict
sample: {
"bfd_enalbe": "enable",
"damp_init_wait_time": null,
"damp_max_wait_time": null,
"damp_second_wait_time": null,
"default_ip": null,
"delayUpTimer": null,
"state": "present",
"tos_exp_dynamic": null,
"tos_exp_static": null
}
existing:
description: k/v pairs of existing configuration
returned: verbose mode
type: dict
sample: {
"global": {
"bfdEnable": "false",
"dampInitWaitTime": "2000",
"dampMaxWaitTime": "12000",
"dampSecondWaitTime": "5000",
"defaultIp": "224.0.0.184",
"delayUpTimer": null,
"tosExp": "7",
"tosExpStatic": "7"
}
}
end_state:
description: k/v pairs of configuration after module execution
returned: verbose mode
type: dict
sample: {
"global": {
"bfdEnable": "true",
"dampInitWaitTime": "2000",
"dampMaxWaitTime": "12000",
"dampSecondWaitTime": "5000",
"defaultIp": "224.0.0.184",
"delayUpTimer": null,
"tosExp": "7",
"tosExpStatic": "7"
}
}
updates:
description: commands sent to the device
returned: always
type: list
sample: [ "bfd" ]
changed:
description: check to see if a change was made on the device
returned: always
type: bool
sample: true
i����N( t ElementTree( t
AnsibleModule( t
get_nc_configt
set_nc_configt ce_argument_spect
check_ip_addrs�
<filter type="subtree">
<bfd xmlns="http://www.huawei.com/netconf/vrp" content-version="1.0" format-version="1.0">
%s
</bfd>
</filter>
sr
<bfdSchGlobal>
<bfdEnable></bfdEnable>
<defaultIp></defaultIp>
<tosExp></tosExp>
<tosExpStatic></tosExpStatic>
<dampInitWaitTime></dampInitWaitTime>
<dampMaxWaitTime></dampMaxWaitTime>
<dampSecondWaitTime></dampSecondWaitTime>
<delayUpTimer></delayUpTimer>
</bfdSchGlobal>
c C s� t | � s t S| j d � d k r) t S| j d � } | d d k sh | d d k sh | d d k rl t S| d j � s� t | d � d k s� t | d � d k r� t St S(
s&