Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arubaoss_interface.py - missleading example #49

Open
Bernhardvleen opened this issue Aug 29, 2022 · 8 comments
Open

arubaoss_interface.py - missleading example #49

Bernhardvleen opened this issue Aug 29, 2022 · 8 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Bernhardvleen
Copy link

Hi,
when configuring interfaces, we can not set state enabled - there is an option admin_stat, but I am not sure what admin_stat exactly does.

from examples section:

  • name: delete qos from port
    arubaoss_interface:
    interface: 5
    qos_policy: "my_qos"
    enable: False

yields error message:

"msg": "Unsupported parameters for (arubaoss_interface) module: enable. Supported parameters include: interface, api_version, username, acl_type, qos_policy, host, acl_id, provider, admin_stat, qos_direction, state, use_ssl, validate_certs, ssh_keyfile, description, port, timeout, password, acl_direction."

in switch config we can put keyword disable (enable most likely is default)

please advice how can we set an interface to disabled state within playbook using this collection and interface module?
maybe you can give me a hint where to find some documentation about the option admin_stat as well, so we can make sure there is no overlap / confusion from this.

I guess it is state - we can set to delete or create while create is default. is delete the same as disable?

many thanks in advance!

@alagoutte
Copy link
Contributor

Yes, there is an error on example

can you try

state: delete

?

admin_stat is for admin port tatus

@Bernhardvleen
Copy link
Author

I tried using state: delete - unfortunately it does not yield the disabled line in the resulting config on the switch for me..

@alagoutte
Copy link
Contributor

I tried using state: delete - unfortunately it does not yield the disabled line in the resulting config on the switch for me..

What the result ?

@Bernhardvleen
Copy link
Author

from ansible-playbook run with verbosity I can see that
we send:

"state": "delete",

but after that we get back:

"is_port_enabled": true,

(see the whole response below)

am I expecting the wrong thing here?

webui and CLI show that indeed the interface is enabled..

 Status and Counters - Port Counters for port 1

  Name  : test int
  MAC Address      : xxxxxxxxx
  Link Status      : Down
  Port Enabled     : Yes

ansible result:

changed: [aosswitch_1] => {
    "changed": true,
    "config_mode": "PCM_AUTO",
    "header": {
        "connection": "close",
        "content-type": "application/json",
        "cookies": {},
        "cookies_string": "",
        "msg": "OK (unknown bytes)",
        "requestid": "",
        "server": "eHTTP v2.0",
        "status": 200,
        "transfer-encoding": "chunked",
        "url": "http://10.10.0.254:80/rest/v7.0/ports/1"
    },
    "id": "1",
    "invocation": {
        "module_args": {
            "acl_direction": null,
            "acl_id": null,
            "acl_type": "AT_STANDARD_IPV4",
            "admin_stat": null,
            "api_version": "v7.0",
            "description": "test int",
            "host": "10.10.0.254",
            "interface": "1",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 80,
            "provider": {
                "api_version": null,
                "host": "10.10.0.254",
                "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "port": 80,
                "ssh_keyfile": null,
                "timeout": 600,
                "transport": "aossapi",
                "use_proxy": false,
                "use_ssl": false,
                "username": "ladmin",
                "validate_certs": false
            },
            "qos_direction": "QPPD_INBOUND",
            "qos_policy": null,
            "ssh_keyfile": null,
            "state": "delete",
            "timeout": 600,
            "use_ssl": false,
            "username": "ladmin",
            "validate_certs": false
        }
    },
    "is_dsnoop_port_trusted": false,
    "is_flow_control_enabled": false,
    "is_port_enabled": true,
    "is_port_up": false,
    "lacp_status": "LAS_DISABLED",
    "name": "test int",
    "trunk_group": "",
    "trunk_mode": "PTT_NONE",
    "uri": "/ports/1"
}

@alagoutte
Copy link
Contributor

you want to disable a port ? or remove qos ?

it is disable a port, you need to use

’’’
interface: X
admin_stat: False
’’’

@Bernhardvleen
Copy link
Author

yes this option works, thank you @alagoutte for your help!

the result of setting
admin_stat: false
is
Port Enabled : No

the example within the module code should be changed.

@alagoutte
Copy link
Contributor

Yes, good idea to have a better example (you can push fix for example!)

@tchiapuziowong tchiapuziowong added the documentation Improvements or additions to documentation label Sep 1, 2022
@tchiapuziowong tchiapuziowong self-assigned this Sep 1, 2022
@Bernhardvleen
Copy link
Author

please be aware, that <state: delete> did not remove the interface for me - not sure what was the reason for this (see above result of my test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants