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

add a new module ce lacp to manage Eth-Trunk interfaces mode #58077

Merged
merged 30 commits into from
Oct 14, 2019
Merged

add a new module ce lacp to manage Eth-Trunk interfaces mode #58077

merged 30 commits into from
Oct 14, 2019

Conversation

yuandongx
Copy link
Contributor

@yuandongx yuandongx commented Jun 19, 2019

SUMMARY

Specifies the working mode of an Eth-Trunk interface.
Specifies lacp preempt enable of Eth-Trunk lacp.
And other lcap options.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

lib/ansible/modules/network/cloudengine/ce_lacp.py

ADDITIONAL INFORMATION

test case

---

- name: test ce_lacp
  gather_facts: no
  hosts: switch6

  tasks:

  - name: "test the correct trunk_id"
    ce_lacp:
      trunk_id: 20
      mode: Dynamic
      state: present

test log

changed: [10.190.121.125] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "end_state": {
        "collectMaxDelay": "0",
        "dampStaFlapEn": "false",
        "dampUnexpMacEn": "true",
        "fastTimeoutUserDefinedValue": "90",
        "hashType": "Enhanced",
        "ifMac": "0005-c096-2e01",
        "ifName": "Eth-Trunk20",
        "isSupportPrmpt": "false",
        "maxActiveNum": "16",
        "maxBandWidth": "0",
        "maxUpNum": "16",
        "memberIfNum": "0",
        "minUpNum": "1",
        "mixRateEnable": "false",
        "onlineMemberIfNum": "0",
        "portUpNum": "0",
        "promptDelay": "30",
        "rcvTimeoutType": "Slow",
        "selectPortStd": "Prority",
        "trunkPortIdExt": "false",
        "trunkType": "EthTrunk",
        "upMemberIfNum": "0",
        "workMode": "Dynamic"
    },
    "existing": {
        "hashType": "Enhanced",
        "ifMac": "0005-c096-2e01",
        "ifName": "Eth-Trunk20",
        "maxBandWidth": "0",
        "maxUpNum": "16",
        "memberIfNum": "0",
        "minUpNum": "1",
        "onlineMemberIfNum": "0",
        "trunkType": "EthTrunk",
        "upMemberIfNum": "0",
        "workMode": "Manual"
    },
    "invocation": {
        "module_args": {
            "collector_delay": null,
            "fast_timeout": null,
            "global_priority": null,
            "max_active_linknumber": null,
            "member_if": null,
            "mixed_rate_link_enable": null,
            "mode": "Dynamic",
            "port_id_extension_enable": null,
            "preempt_delay": null,
            "preempt_enable": null,
            "priority": null,
            "select": null,
            "state": "present",
            "state_flapping": null,
            "system_id": null,
            "trunk_id": "20",
            "unexpected_mac_disable": null,
        }
    },
    "proposed": {
        "mode": "Dynamic",
        "state": "present",
        "trunk_id": "20"
    },
    "updates": [
        "lacp select Prority",
        "lacp mixed-rate link enable false",
        "lacp port-id-extension enable false",
        "lacp timeout Slow",
        "lacp dampening unexpected-mac disable true",
        "lacp timeout user-defined 90",
        "lacp max active-linknumber 16",
        "lacp dampening state-flapping false",
        "lacp preempt delay 30",
        "lacp preempt enable false",
        "lacp collector delay 0"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP ******************************************************************************************************************************************************
10.190.121.125             : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

show on device.

[~8850_130.12-Eth-Trunk20]di th
#
interface Eth-Trunk20
 undo portswitch
 ip address 30.2.2.6 255.255.255.0
 isis enable 3
 isis circuit-type p2p
 isis circuit-level level-2
 isis cost 50 level-1
 isis cost 40 level-2
 isis ppp-negotiation 2-way
 isis peer-ip-ignore
 isis ppp-osicp-check
 mode lacp-dynamic
#
return
[~8850_130.12-Eth-Trunk20]

test case


  - name: "test the correct preempt_enable"
    ce_lacp:
      trunk_id: 20
      preempt_enable: true
      state_flapping: true
      port_id_extension_enable: true
      unexpected_mac_disable: true
      state: present

test log


changed: [10.190.121.125] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "end_state": {
        "dampStaFlapEn": "true",
        "dampUnexpMacEn": "true",
        "ifName": "Eth-Trunk20",
        "isSupportPrmpt": "true",
        "trunkPortIdExt": "true"
    },
    "existing": {
        "dampStaFlapEn": "false",
        "dampUnexpMacEn": "true",
        "ifName": "Eth-Trunk20",
        "isSupportPrmpt": "false",
        "trunkPortIdExt": "false"
    },
    "invocation": {
        "module_args": {
            "collector_delay": null,
            "fast_timeout": null,
            "global_priority": null,
            "host": "10.190.121.125",
            "max_active_linknumber": null,
            "member_if": null,
            "mixed_rate_link_enable": null,
            "mode": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 10111,
            "port_id_extension_enable": "true",
            "preempt_delay": null,
            "preempt_enable": "true",
            "priority": null,
            "select": null,
            "state": "present",
            "state_flapping": "true",
            "system_id": null,
            "transport": "cli",
            "trunk_id": "20",
            "unexpected_mac_disable": "true",
        }
    },
    "proposed": {
        "port_id_extension_enable": "true",
        "preempt_enable": "true",
        "state": "present",
        "state_flapping": "true",
        "trunk_id": "20",
        "unexpected_mac_disable": "true"
    },
    "updates": [
        "lacp port-id-extension enable",
        "lacp preempt enable",
        "lacp dampening state-flapping"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP ******************************************************************************************************************************************************
10.190.121.125             : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

show on device.

[~8850_130.12-Eth-Trunk20]di th
#
interface Eth-Trunk20
 undo portswitch
 ip address 30.2.2.6 255.255.255.0
 isis enable 3
 isis circuit-type p2p
 isis circuit-level level-2
 isis cost 50 level-1
 isis cost 40 level-2
 isis ppp-negotiation 2-way
 isis peer-ip-ignore
 isis ppp-osicp-check
 mode lacp-dynamic
 lacp dampening state-flapping
 lacp preempt enable
 lacp port-id-extension enable
#
return
[~8850_130.12-Eth-Trunk20]

test case


  - name: "Step7.1.1 test the correct system_id"
    ce_lacp:
      trunk_id: 20
      system_id: a-a-a
      timeout_type: Fast
      fast_timeout: 3
      preempt_delay: 180
      collector_delay: 65535
      state: present

test log


changed: [10.190.121.125] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "end_state": {
        "collectMaxDelay": "65535",
        "fastTimeoutUserDefinedValue": "3",
        "ifName": "Eth-Trunk20",
        "promptDelay": "180",
        "rcvTimeoutType": "Fast",
        "trunkSysMac": "000a-000a-000a"
    },
    "existing": {
        "collectMaxDelay": "0",
        "fastTimeoutUserDefinedValue": "90",
        "ifName": "Eth-Trunk20",
        "promptDelay": "30",
        "rcvTimeoutType": "Slow"
    },
    "invocation": {
        "module_args": {
            "collector_delay": 65535,
            "fast_timeout": 3,
            "global_priority": null,
            "max_active_linknumber": null,
            "member_if": null,
            "mixed_rate_link_enable": null,
            "mode": null,
            "port_id_extension_enable": null,
            "preempt_delay": 180,
            "preempt_enable": null,
            "priority": null,
            "select": null,
            "state": "present",
            "state_flapping": null,
            "system_id": "a-a-a",
            "timeout_type": "Fast",
            "trunk_id": "20",
            "unexpected_mac_disable": null,
        }
    },
    "proposed": {
        "collector_delay": 65535,
        "fast_timeout": 3,
        "preempt_delay": 180,
        "state": "present",
        "system_id": "a-a-a",
        "timeout_type": "Fast",
        "trunk_id": "20"
    },
    "updates": [
        "lacp system-id 000a-000a-000a",
        "lacp preempt delay 180",
        "lacp timeout fast",
        "lacp collector delay 65535",
        "lacp timeout user-defined 3"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP ******************************************************************************************************************************************************
10.190.121.125             : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

show on device.

[~8850_130.12-Eth-Trunk20]di th
#
interface Eth-Trunk20
 undo portswitch
 ip address 30.2.2.6 255.255.255.0
 isis enable 3
 isis circuit-type p2p
 isis circuit-level level-2
 isis cost 50 level-1
 isis cost 40 level-2
 isis ppp-negotiation 2-way
 isis peer-ip-ignore
 isis ppp-osicp-check
 mode lacp-dynamic
 lacp timeout fast
 lacp dampening state-flapping
 lacp preempt enable
 lacp preempt delay 180
 lacp collector delay 65535
 lacp system-id 000a-000a-000a
 lacp port-id-extension enable
#
return
[~8850_130.12-Eth-Trunk20]

test case


  - name: "Step15.1.1 test the correct member_if"
    ce_lacp:
      trunk_id: 21
      mode: Static
      member_if: 100GE1/0/23
      priority: 10
      state: present

test log


changed: [10.190.121.125] => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "end_state": {
        "ifName": "Eth-Trunk21",
        "memberIfName": "100GE1/0/23",
        "portPriority": "10",
        "workMode": "Static"
    },
    "existing": {},
    "invocation": {
        "module_args": {
            "collector_delay": null,
            "fast_timeout": null,
            "global_priority": null,
            "host": "10.190.121.125",
            "max_active_linknumber": null,
            "member_if": "100GE1/0/23",
            "mixed_rate_link_enable": null,
            "mode": "Static",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 10111,
            "port_id_extension_enable": null,
            "preempt_delay": null,
            "preempt_enable": null,
            "priority": 10,
            "select": null,
            "ssh_keyfile": null,
            "state": "present",
            "state_flapping": null,
            "system_id": null,
            "timeout": null,
            "timeout_type": null,
            "trunk_id": "21",
            "unexpected_mac_disable": null,
        }
    },
    "proposed": {
        "member_if": "100GE1/0/23",
        "mode": "Static",
        "priority": 10,
        "state": "present",
        "trunk_id": "21"
    },
    "updates": [
        "lacp priority 10"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP ******************************************************************************************************************************************************
10.190.121.125             : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

show on device.

[~8850_130.12-Eth-Trunk21]di th
#
interface Eth-Trunk21
 mode lacp-static
#
return
[~8850_130.12-Eth-Trunk21]

[~8850_130.12-100GE1/0/23]di th
#
interface 100GE1/0/23
 eth-trunk 21
 lacp priority 10
#
return
[~8850_130.12-100GE1/0/23]

@ansibot
Copy link
Contributor

ansibot commented Jun 19, 2019

@xuxiaowei0512 this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jun 19, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/network/cloudengine/ce_lacp.py:152:161: E501 line too long (171 > 160 characters)

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jun 19, 2019

@xuxiaowei0512, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 ci_verified Changes made in this PR are causing tests to fail. merge_commit This PR contains at least one merge commit. Please resolve! module This issue/PR relates to a module. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. networking Network category new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jun 19, 2019
@ansibot
Copy link
Contributor

ansibot commented Jun 20, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/network/cloudengine/ce_lacp.py:152:161: E501 line too long (171 > 160 characters)

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. community_review In order to be merged, this PR must follow the community review workflow. and removed community_review In order to be merged, this PR must follow the community review workflow. ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jun 20, 2019
@ansibot
Copy link
Contributor

ansibot commented Jun 20, 2019

@CloudEngine-Ansible @numone213

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@yuandongx yuandongx marked this pull request as ready for review June 20, 2019 13:10
@ansibot
Copy link
Contributor

ansibot commented Jun 28, 2019

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 28, 2019
@yuandongx
Copy link
Contributor Author

@Andersson007 Thank you for your reviewing. I have update the code, some of your suggestions are so good for me.

@yuandongx
Copy link
Contributor Author

ready_for_review

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 10, 2019
@yuandongxx
Copy link
Contributor

LGTM

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed core_review In order to be merged, this PR must follow the core review workflow. labels Oct 12, 2019
@gundalow gundalow merged commit 36457be into ansible:devel Oct 14, 2019
@yuandongx
Copy link
Contributor Author

@gundalow Thank you very much.Good luck!

@yuandongx yuandongx deleted the dev/new/ce_lacp branch October 15, 2019 06:18
@ansible ansible locked and limited conversation to collaborators Nov 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 has_issue module This issue/PR relates to a module. networking Network category new_module This PR includes a new module. new_plugin This PR includes a new plugin. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants