aruba/aos-switch-ansible-collection

Spanning Tree Option Loop-Guard

Closed this issue · 11 comments

Hi,
I cannot find an option to set loop-guard within the module
https://github.com/aruba/aos-switch-ansible-collection/blob/master/plugins/modules/arubaoss_stp.py

is there another one that has it?

hopefully the API is complete regarding all available configuration options and no limitation comes from there.

many thanks in advance for your help!

I think I have found it - it is not within the interface module but has an extra one
https://github.com/aruba/aos-switch-ansible-collection/blob/master/plugins/modules/arubaoss_loop_protect.py

hopefully the API is complete regarding all available configuration options and no limitation comes from there.

this is the docu page for it: https://www.arubanetworks.com/techdocs/AOS-CX/10.08/HTML/l2_bridging_4100i-6000-6100-6200/Content/Chp_stp/mstp_cmds/spa-tre-loo-gua.htm

/!\ it is the API doc for Aruba CX not the Aruba OS

/!\ it is the API doc for Aruba CX not the Aruba OS

thank you for pointing that out! I made an edit to remove the wrong link from my above comment..

I am actually reopening this issue, since it is a pity, that there is no option to add the loop-guard option.

atm I have to make an extra task to add it via arubaoss_config which does open me up for ridicule from others. in it self that is no problem, since only my ego is affected, but there is also the component of "why do you use this if it is not complete" - which this awesome collection does not deserve...

current playbook: (untested)

- hosts: all
  collections:
    - arubanetworks.aos_switch
  tasks:
    - name: Set Spanning Tree for Interface "{{ item.int_nr }}"
      arubaoss_stp:
        port_id: "{{ item.int_nr }}"
        is_enable_admin_edge_port: "{{ item.enabled_admin }}"
        is_enable_bpdu_protection: "{{ item.enabled_bpdu }}"
        command: config_spanning_tree_port

    - name: 
      arubaoss_config:
        lines: 
          - spanning-tree "{{ item.int_nr }}" loop-guard
          

      with_item:
        - { int_nr: "1", description: "name", enabled_admin: "true", enabled_bpdu: "true" }
        - { int_nr: "2", description: "name", enabled_admin: "true", enabled_bpdu: "true"  }
        - { int_nr: "3", description: "name", enabled_admin: "true", enabled_bpdu: "true"  }
        - { int_nr: "4", description: "name", enabled_admin: "true", enabled_bpdu: "true"  }
        - { int_nr: "5", description: "name", enabled_admin: "true", enabled_bpdu: "true"  }
        - { int_nr: "6", description: "name", enabled_admin: "true", enabled_bpdu: "true"  }
        - .
        - .
        - .
        - .

I am not sure if this is the same thing as setting loop-guard..

  • name: enable loop-prtoect on port
    arubaoss_loop_protect:
    command: update_port
    interface: 1

  • name: Set Spanning Tree for Interface "{{ item.int_nr }}"
    arubaoss_stp:
    port_id: 1
    is_enable_admin_edge_port: true
    is_enable_bpdu_protection: true

I ran this tasks but the interface only show the other options nothing about loop-guard

spanning-tree 1 admin-edge-port
spanning-tree 1 bpdu-protection

does this line

<loop-protect 1>

mean the same as

<spanning-tree 1 loop-guard>

?

a special problem is, that I have to use the config module for the loop-guard lines, which means that I have to make a separate playbook since we can not change connection type within a playbook..

apparently the option is_enable_bpdu_filter: is a good candidate for what I know as loop-guard - can you confirm that?

loop-protect is something else entirely

apparently the option is_enable_bpdu_filter: is a good candidate for what I know as loop-guard - can you confirm that?

Need to try...

loop-protect is something else entirely
Yes !

Based on the API documentation it doesn't look like this option is available through the API - configuring through SSH seems to be the only option

Available options through API:

{
    "$schema": "http://json-schema.org/draft-04/schema#", 
    "description": "Spanning tree per port configuration.", 
    "title": "SpanningTreePort", 
    "type": "object", 
    "properties":
    {
        "uri":
        {
            "description": "The URI of the configuration entity", 
            "type": "string", 
            "readonly": true
        }, 
        "port_id":
        {
            "description": "Port Id.", 
            "type": "string", 
            "maxLength": 9, 
            "minLength": 1, 
            "sql.not_null": true
        }, 
        "priority":
        {
            "description": "Priority.Not applicable in RPVST mode.", 
            "minimum": 0, 
            "maximum": 15, 
            "type": "integer", 
            "default_value": 8
        }, 
        "is_enable_admin_edge_port":
        {
            "description": "Enable/Disable admin-edge-port.", 
            "type": "boolean"
        }, 
        "is_enable_bpdu_protection":
        {
            "description": "Enable/Disable bpdu-protection.", 
            "type": "boolean"
        }, 
        "is_enable_bpdu_filter":
        {
            "description": "Enable/Disable bpdu-filter.", 
            "type": "boolean"
        }, 
        "is_enable_root_guard":
        {
            "description": "Enable/Disable root-guard.", 
            "type": "boolean"
        }, 
        "is_enable_pvst_filter":
        {
            "description": "Enable/Disable pvst-filter.", 
            "type": "boolean"
        }, 
        "is_enable_pvst_protection":
        {
            "description": "Enable/Disable pvst-protection.", 
            "type": "boolean"
        }
    }
}

I can not understand why this option is not there in the API - both bpdu guard / filter options are not as important as loop-guard on interfaces imho and they are there - is there any chance that the API will be expanded with this (and some other things..) - or is there a technical limitation?

Hi @Bernhardvleen - at this time there are no plans to develop new features or capabilities in the API