community.general.ce_stp (0.1.1) — module

Manages STP configuration on HUAWEI CloudEngine switches.

Authors: wangdezhuang (@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 STP configurations on HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: CloudEngine stp 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: "Config stp mode"
    ce_stp:
      state: present
      stp_mode: stp
      provider: "{{ cli }}"

  - name: "Undo stp mode"
    ce_stp:
      state: absent
      stp_mode: stp
      provider: "{{ cli }}"

  - name: "Enable bpdu protection"
    ce_stp:
      state: present
      bpdu_protection: enable
      provider: "{{ cli }}"

  - name: "Disable bpdu protection"
    ce_stp:
      state: present
      bpdu_protection: disable
      provider: "{{ cli }}"

Inputs

    
cost:
    description:
    - Set the path cost of the current port. The default instance is 0.

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Specify desired state of the resource.

stp_mode:
    choices:
    - stp
    - rstp
    - mstp
    description:
    - Set an operation mode for the current MSTP process. The mode can be STP, RSTP, or
      MSTP.

interface:
    description:
    - Interface name. If the value is C(all), will apply configuration to all interfaces.
      if the value is a special name, only support input the full name.

edged_port:
    choices:
    - enable
    - disable
    description:
    - Set the current port as an edge port.

stp_enable:
    choices:
    - enable
    - disable
    description:
    - Enable or disable STP on a switch.

bpdu_filter:
    choices:
    - enable
    - disable
    description:
    - Specify a port as a BPDU filter port.

stp_converge:
    choices:
    - fast
    - normal
    description:
    - STP convergence mode. Fast means set STP aging mode to Fast. Normal means set STP
      aging mode to Normal.

tc_protection:
    choices:
    - enable
    - disable
    description:
    - Configure the TC BPDU protection function for an MSTP process.

bpdu_protection:
    choices:
    - enable
    - disable
    description:
    - Configure BPDU protection on an edge port. This function prevents network flapping
      caused by attack packets.

loop_protection:
    choices:
    - enable
    - disable
    description:
    - Enable loop protection on the current port.

root_protection:
    choices:
    - enable
    - disable
    description:
    - Enable root protection on the current port.

tc_protection_interval:
    description:
    - Set the time the MSTP device takes to handle the maximum number of TC BPDUs and
      immediately refresh forwarding entries. The value is an integer ranging from 1 to
      600, in seconds.

tc_protection_threshold:
    description:
    - Set the maximum number of TC BPDUs that the MSTP can handle. The value is an integer
      ranging from 1 to 255. The default value is 1 on the switch.

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 aaa params after module execution
  returned: always
  sample:
    bpdu_protection: enable
  type: dict
existing:
  description: k/v pairs of existing aaa server
  returned: always
  sample:
    bpdu_protection: disable
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    bpdu_protection: enable
    state: present
  type: dict
updates:
  description: command sent to the device
  returned: always
  sample:
  - stp bpdu-protection
  type: list