On this page
ce_stp - Manages STP configuration on HUAWEI CloudEngine switches.
New in version 2.4.
Synopsis
- Manages STP configurations on HUAWEI CloudEngine switches.
 
Parameters
| Parameter | Choices/Defaults | Comments | 
|---|---|---|
| bpdu_filter | 
       
  | 
      
        
        Specify a port as a BPDU filter port.
         | 
     
| bpdu_protection | 
       
  | 
      
        
        Configure BPDU protection on an edge port. This function prevents network flapping caused by attack packets.
         | 
     
| cost | 
        
        Set the path cost of the current port. The default instance is 0.
         | 
     |
| edged_port | 
       
  | 
      
        
        Set the current port as an edge port.
         | 
     
| interface | 
        
        Interface name. If the value is  all, will apply configuration to all interfaces. if the value is a special name, only support input the full name.
        | 
     |
| loop_protection | 
       
  | 
      
        
        Enable loop protection on the current port.
         | 
     
| root_protection | 
       
  | 
      
        
        Enable root protection on the current port.
         | 
     
| state | 
       
  | 
      
        
        Specify desired state of the resource.
         | 
     
| stp_converge | 
       
  | 
      
        
        STP convergence mode. Fast means set STP aging mode to Fast. Normal means set STP aging mode to Normal.
         | 
     
| stp_enable | 
       
  | 
      
        
        Enable or disable STP on a switch.
         | 
     
| stp_mode | 
       
  | 
      
        
        Set an operation mode for the current MSTP process. The mode can be STP, RSTP, or MSTP.
         | 
     
| tc_protection | 
       
  | 
      
        
        Configure the TC BPDU protection function for an MSTP process.
         | 
     
| tc_protection_interval | 
        
        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 | 
        
        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.
         | 
     
Examples
- 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 }}"
  Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | 
|---|---|---|
| changed  
        boolean
         | 
      always | 
        
        check to see if a change was made on the device
         Sample:
        
       
        True
         | 
     
| end_state  
        dict
         | 
      always | 
        
        k/v pairs of aaa params after module execution
         Sample:
        
       
        {'bpdu_protection': 'enable'}
         | 
     
| existing  
        dict
         | 
      always | 
        
        k/v pairs of existing aaa server
         Sample:
        
       
        {'bpdu_protection': 'disable'}
         | 
     
| proposed  
        dict
         | 
      always | 
        
        k/v pairs of parameters passed into module
         Sample:
        
       
        {'bpdu_protection': 'enable', 'state': 'present'}
         | 
     
| updates  
        list
         | 
      always | 
        
        command sent to the device
         Sample:
        
       
        ['stp bpdu-protection']
         | 
     
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Maintenance
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Author
- wangdezhuang (@CloudEngine-Ansible)
 
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
 https://docs.ansible.com/ansible/2.6/modules/ce_stp_module.html