community.general.ce_bfd_session (0.1.1) — module

Manages BFD session configuration on HUAWEI CloudEngine devices.

Authors: QijunPan (@QijunPan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Manages BFD session configuration, creates a BFD session or deletes a specified BFD session on HUAWEI CloudEngine devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: bfd session 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: Configuring Single-hop BFD for Detecting Faults on a Layer 2 Link
    ce_bfd_session:
      session_name: bfd_l2link
      use_default_ip: true
      out_if_name: 10GE1/0/1
      local_discr: 163
      remote_discr: 163
      provider: '{{ cli }}'

  - name: Configuring Single-Hop BFD on a VLANIF Interface
    ce_bfd_session:
      session_name: bfd_vlanif
      dest_addr: 10.1.1.6
      out_if_name: Vlanif100
      local_discr: 163
      remote_discr: 163
      provider: '{{ cli }}'

  - name: Configuring Multi-Hop BFD
    ce_bfd_session:
      session_name: bfd_multi_hop
      dest_addr: 10.1.1.1
      local_discr: 163
      remote_discr: 163
      provider: '{{ cli }}'

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - Determines whether the config should be present or not on the device.

src_addr:
    description:
    - Indicates the source IP address carried in BFD packets.

vrf_name:
    description:
    - Specifies the name of a Virtual Private Network (VPN) instance that is bound to
      a BFD session. The value is a string of 1 to 31 case-sensitive characters, spaces
      not supported. When double quotation marks are used around the string, spaces are
      allowed in the string. The value _public_ is reserved and cannot be used as the
      VPN instance name.

addr_type:
    choices:
    - ipv4
    description:
    - Specifies the peer IP address type.

dest_addr:
    description:
    - Specifies the peer IP address bound to the BFD session.

create_type:
    choices:
    - static
    - auto
    default: static
    description:
    - BFD session creation mode, the currently created BFD session only supports static
      or static auto-negotiation mode.

local_discr:
    description:
    - The BFD session local identifier does not need to be configured when the mode is
      auto.

out_if_name:
    description:
    - Specifies the type and number of the interface bound to the BFD session.

remote_discr:
    description:
    - The BFD session remote identifier does not need to be configured when the mode is
      auto.

session_name:
    description:
    - Specifies the name of a BFD session. The value is a string of 1 to 15 case-sensitive
      characters without spaces.
    required: true

use_default_ip:
    default: 'no'
    description:
    - Indicates the default multicast IP address that is bound to a BFD session. By default,
      BFD uses the multicast IP address 224.0.0.184. You can set the multicast IP address
      by running the default-ip-address command. The value is a bool type.
    type: bool

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: bool
end_state:
  description: k/v pairs of configuration after module execution
  returned: always
  sample:
    session:
      addrType: IPV4
      createType: SESS_STATIC
      destAddr: null
      outIfName: 10GE1/0/1
      sessName: bfd_l2link
      srcAddr: null
      useDefaultIp: 'true'
      vrfName: null
  type: dict
existing:
  description: k/v pairs of existing configuration
  returned: always
  sample:
    session: {}
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    addr_type: null
    create_type: null
    dest_addr: null
    out_if_name: 10GE1/0/1
    session_name: bfd_l2link
    src_addr: null
    state: present
    use_default_ip: true
    vrf_name: null
  type: dict
updates:
  description: commands sent to the device
  returned: always
  sample:
  - bfd bfd_l2link bind peer-ip default-ip interface 10ge1/0/1
  type: list