CiscoDevNet / ansible-aci

Cisco ACI Ansible Collection
https://galaxy.ansible.com/cisco/aci
GNU General Public License v3.0
143 stars 97 forks source link

Add auto to link level speed options #577

Closed edudppaz closed 10 months ago

edudppaz commented 10 months ago

"auto" for the link level policy is missing from the choices in the ansible module. This adds the "auto" option to allow an auto negotiating interface speed to be configured on the APIC controller

edudppaz commented 10 months ago

@akinross i have updated the documentation and added the new integration tests. i tried to run the whole test playbook to verify, but im getting throttled by the Cisco sandbox APIC API, and its not possible to change to certificate-based authentication. I could at least get some snippets from it:

Running aci_interface_policy_link_level integration test role

PLAY [aci] *********************************************************************

TASK [aci_interface_policy_link_level : Test that we have an ACI APIC host, ACI username and ACI password] ***
skipping: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Verify Cloud and Non-Cloud Sites in use.] ***
included: /Users/edpozo/Git/AIB/ansible_collections/cisco/aci/tests/integration/targets/aci_cloud_provider/tasks/main.yml for sandboxapicdc.cisco.com

TASK [aci_interface_policy_link_level : Test that we have an ACI APIC host, ACI username and ACI password] ***
skipping: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Set vars] ******************************
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Query system information] **************
[WARNING]: Platform darwin on host sandboxapicdc.cisco.com is using the
discovered Python interpreter at /opt/homebrew/bin/python3.11, but future
installation of another Python interpreter could change the meaning of that
path. See https://docs.ansible.com/ansible-
core/2.15/reference_appendices/interpreter_discovery.html for more information.
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Query cloud provider object] ***********
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Set vars] ******************************
skipping: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Verify query_cloud for all sites] ******
ok: [sandboxapicdc.cisco.com] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aci_interface_policy_link_level : Verify query_cloud for Cloud Sites] ****
skipping: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Remove Link Level Policy] **************
changed: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Add Link Level Policy (check mode)] ****
changed: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Add Link Level Policy (normal mode)] ***
changed: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Verify Add Link Level Policy] **********
ok: [sandboxapicdc.cisco.com] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aci_interface_policy_link_level : Add Link Level Policy again (check mode)] ***
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Add Link Level Policy again (normal mode)] ***
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Verify Add Link Level Policy again] ****
ok: [sandboxapicdc.cisco.com] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aci_interface_policy_link_level : Change description of Link Level Policy (check mode)] ***
changed: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Change description of Link Level Policy (normal mode)] ***
changed: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Verify add_policy_descr] ***************
ok: [sandboxapicdc.cisco.com] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aci_interface_policy_link_level : Change description of Link Level Policy again (check mode)] ***
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Change description of Link Level Policy again (normal mode)] ***
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Verify add_policy_descr_again] *********
ok: [sandboxapicdc.cisco.com] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aci_interface_policy_link_level : Add Link Level Policy again with no description (check mode)] ***
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Add Link Level Policy again with no description (normal mode)] ***
ok: [sandboxapicdc.cisco.com]

TASK [aci_interface_policy_link_level : Verify add_policy_again_no_descr] ******
ok: [sandboxapicdc.cisco.com] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aci_interface_policy_link_level : Add Link Level Policy with various speeds (check mode)] ***
changed: [sandboxapicdc.cisco.com] => (item=speed-100M)
changed: [sandboxapicdc.cisco.com] => (item=speed-1G)
changed: [sandboxapicdc.cisco.com] => (item=speed-10G)
changed: [sandboxapicdc.cisco.com] => (item=speed-25G)
changed: [sandboxapicdc.cisco.com] => (item=speed-40G)
changed: [sandboxapicdc.cisco.com] => (item=speed-50G)
changed: [sandboxapicdc.cisco.com] => (item=speed-100G)
changed: [sandboxapicdc.cisco.com] => (item=speed-200G)
changed: [sandboxapicdc.cisco.com] => (item=speed-400G)
changed: [sandboxapicdc.cisco.com] => (item=speed-auto)
ok: [sandboxapicdc.cisco.com] => (item=speed-inherit)

TASK [aci_interface_policy_link_level : Add Link Level Policy with various speeds (normal mode)] ***
changed: [sandboxapicdc.cisco.com] => (item=speed-100M)
changed: [sandboxapicdc.cisco.com] => (item=speed-1G)
changed: [sandboxapicdc.cisco.com] => (item=speed-10G)
changed: [sandboxapicdc.cisco.com] => (item=speed-25G)
changed: [sandboxapicdc.cisco.com] => (item=speed-40G)
changed: [sandboxapicdc.cisco.com] => (item=speed-50G)
edudppaz commented 10 months ago

Got the whole tests running.

PLAY RECAP *********************************************************************
sandboxapicdc.cisco.com    : ok=43   changed=9    unreachable=0    failed=0    skipped=4    rescued=0    ignored=2   
codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (647dc30) 96.26% compared to head (666be5e) 35.20%. Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #577 +/- ## =========================================== - Coverage 96.26% 35.20% -61.06% =========================================== Files 231 231 Lines 10647 10663 +16 Branches 1603 1607 +4 =========================================== - Hits 10249 3754 -6495 - Misses 305 6909 +6604 + Partials 93 0 -93 ``` | [Flag](https://app.codecov.io/gh/CiscoDevNet/ansible-aci/pull/577/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CiscoDevNet) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/CiscoDevNet/ansible-aci/pull/577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CiscoDevNet) | `?` | | | [sanity](https://app.codecov.io/gh/CiscoDevNet/ansible-aci/pull/577/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CiscoDevNet) | `35.20% <ø> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CiscoDevNet#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lhercot commented 10 months ago

Thanks for your contribution!