From 803d2db773e57c2d83408ba65a93d48cebc6e6f8 Mon Sep 17 00:00:00 2001 From: Ole Myhre Date: Mon, 5 Dec 2022 12:18:08 +0100 Subject: [PATCH 1/2] Added SVI autostate to aci_l3out_interface --- plugins/modules/aci_l3out_interface.py | 10 +++++++++- .../targets/aci_l3out_interface/tasks/main.yml | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/modules/aci_l3out_interface.py b/plugins/modules/aci_l3out_interface.py index b58ca1315..6caddb27d 100644 --- a/plugins/modules/aci_l3out_interface.py +++ b/plugins/modules/aci_l3out_interface.py @@ -90,6 +90,11 @@ type: str choices: [ absent, present, query ] default: present + autostate: + description: + - SVI auto state. + type: str + choices: [ enabled, disabled ] extends_documentation_fragment: - cisco.aci.aci - cisco.aci.annotation @@ -302,6 +307,7 @@ def main(): interface_type=dict(type="str", choices=["l3-port", "sub-interface", "ext-svi"]), mode=dict(type="str", choices=["regular", "native", "untagged"]), encap=dict(type="str"), + autostate=dict(type="str", choices=["enabled", "disabled"]), ) module = AnsibleModule( @@ -327,6 +333,7 @@ def main(): interface_type = module.params.get("interface_type") mode = module.params.get("mode") encap = module.params.get("encap") + autostate = module.params.get("autostate") aci = ACIModule(module) if node_id and "-" in node_id: @@ -383,7 +390,8 @@ def main(): mtu=mtu, ifInstT=interface_type, mode=mode, - encap=encap + encap=encap, + autostate=autostate ), ) diff --git a/tests/integration/targets/aci_l3out_interface/tasks/main.yml b/tests/integration/targets/aci_l3out_interface/tasks/main.yml index d82fa61e0..b78d9c1c8 100644 --- a/tests/integration/targets/aci_l3out_interface/tasks/main.yml +++ b/tests/integration/targets/aci_l3out_interface/tasks/main.yml @@ -133,6 +133,7 @@ addr: 192.168.50.1/27 ipv6_dad: disabled mtu: 1500 + autostate: disabled state: present register: add_l3out_interface @@ -143,6 +144,7 @@ - add_l3out_interface.current.0.l3extRsPathL3OutAtt.attributes.addr == "192.168.50.1/27" - add_l3out_interface.current.0.l3extRsPathL3OutAtt.attributes.ipv6Dad == "disabled" - add_l3out_interface.current.0.l3extRsPathL3OutAtt.attributes.mtu == "1500" + - add_l3out_interface.current.0.l3extRsPathL3OutAtt.attributes.autostate == "disabled" - add_l3out_interface.current.0.l3extRsPathL3OutAtt.attributes.ifInstT == "l3-port" - add_l3out_interface.current.0.l3extRsPathL3OutAtt.attributes.mode == "regular" - add_l3out_interface.current.0.l3extRsPathL3OutAtt.attributes.annotation == 'orchestrator:ansible' @@ -163,6 +165,7 @@ addr: 192.168.50.1/27 ipv6_dad: disabled mtu: 1500 + autostate: disabled state: present register: add_l3out_interface_again From 87df964bf1df7dd97d19fdf5967a0dbfc0fb806a Mon Sep 17 00:00:00 2001 From: Lionel Hercot Date: Thu, 12 Jan 2023 13:02:45 -0800 Subject: [PATCH 2/2] [ignore] Rename autostate to auto_state in aci_l3out_interface --- plugins/modules/aci_l3out_interface.py | 8 ++++---- .../targets/aci_l3out_interface/tasks/main.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/modules/aci_l3out_interface.py b/plugins/modules/aci_l3out_interface.py index 6caddb27d..c0ffa675f 100644 --- a/plugins/modules/aci_l3out_interface.py +++ b/plugins/modules/aci_l3out_interface.py @@ -90,7 +90,7 @@ type: str choices: [ absent, present, query ] default: present - autostate: + auto_state: description: - SVI auto state. type: str @@ -307,7 +307,7 @@ def main(): interface_type=dict(type="str", choices=["l3-port", "sub-interface", "ext-svi"]), mode=dict(type="str", choices=["regular", "native", "untagged"]), encap=dict(type="str"), - autostate=dict(type="str", choices=["enabled", "disabled"]), + auto_state=dict(type="str", choices=["enabled", "disabled"]), ) module = AnsibleModule( @@ -333,7 +333,7 @@ def main(): interface_type = module.params.get("interface_type") mode = module.params.get("mode") encap = module.params.get("encap") - autostate = module.params.get("autostate") + auto_state = module.params.get("auto_state") aci = ACIModule(module) if node_id and "-" in node_id: @@ -391,7 +391,7 @@ def main(): ifInstT=interface_type, mode=mode, encap=encap, - autostate=autostate + autostate=auto_state ), ) diff --git a/tests/integration/targets/aci_l3out_interface/tasks/main.yml b/tests/integration/targets/aci_l3out_interface/tasks/main.yml index b78d9c1c8..c4d6f8495 100644 --- a/tests/integration/targets/aci_l3out_interface/tasks/main.yml +++ b/tests/integration/targets/aci_l3out_interface/tasks/main.yml @@ -133,7 +133,7 @@ addr: 192.168.50.1/27 ipv6_dad: disabled mtu: 1500 - autostate: disabled + auto_state: disabled state: present register: add_l3out_interface @@ -165,7 +165,7 @@ addr: 192.168.50.1/27 ipv6_dad: disabled mtu: 1500 - autostate: disabled + auto_state: disabled state: present register: add_l3out_interface_again