-
Notifications
You must be signed in to change notification settings - Fork 98
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
enhancement for node_mgmt_epg_to_contract (DCNE-87) #658
base: master
Are you sure you want to change the base?
Conversation
9010dbf
to
820f4cc
Compare
820f4cc
to
2873077
Compare
argument_spec.update(aci_annotation_spec()) | ||
argument_spec.update( | ||
contract_type=dict(type="str", choices=["consumer", "provider", "taboo", "interface"], required=True), | ||
epg_type=dict(type="str", aliases=["type"], choices=["in_band","out_of_band"], required=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
epg_type=dict(type="str", aliases=["type"], choices=["in_band","out_of_band"], required=True) | |
epg_type=dict(type="str", aliases=["type"], choices=["in_band","out_of_band"], required=True), |
This should fix the black formatting error. Please run black -l 159
to format this one.
…ontract.url does not exist remain
# Copyright: (c) 2017, Jacob McGill (@jmcgill298) | ||
# Copyright: (c) 2023, Akini Ross (@akinross) <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove and put your own
argument_spec = aci_argument_spec() | ||
argument_spec.update(aci_annotation_spec()) | ||
argument_spec.update( | ||
contract_type=dict(type="str", choices=["consumer", "provider", "taboo", "interface"], required=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs do not match [ consumer, provider, taboo, interface, intra_epg ]
- Jacob McGill (@jmcgill298) | ||
- Akini Ross (@akinross) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use your own
|
||
DOCUMENTATION = r""" | ||
--- | ||
module: aci_epg_to_contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong module name
module: aci_epg_to_contract | ||
short_description: Bind EPGs to Contracts (fv:RsCons, fv:RsProv, fv:RsProtBy, fv:RsConsIf, and fv:RsIntraEpg) | ||
description: | ||
- Bind EPGs to Contracts on Cisco ACI fabrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specific to magement node
class_config = {"prio": priority, aci_name: contract} | ||
|
||
if contract_type != "provider": | ||
module.fail_json(msg="out_of_band EPG only supports Provider contract attachment.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module.fail_json(msg="out_of_band EPG only supports Provider contract attachment.") | |
module.fail_json(msg="only 'provider' contract_type is supported for 'out_of_band' epg_type") |
root_class=dict( | ||
aci_class="fvTenant", | ||
aci_rn="tn-mgmt", | ||
module_object="mgmt", | ||
target_filter={"name": "mgmt"}, | ||
), | ||
subclass_1=dict( | ||
aci_class="mgmtMgmtP", | ||
aci_rn="mgmtp-default", | ||
module_object="default", | ||
target_filter={"name": "default"}, | ||
), | ||
subclass_2=dict( | ||
aci_class=class_Map[epg_type][0]["epg_class"], | ||
aci_rn=class_Map[epg_type][0]["epg_rn"].format(epg), | ||
module_object=epg, | ||
target_filter={"name": epg}, | ||
), | ||
subclass_3=dict( | ||
aci_class=aci_class, | ||
aci_rn="{0}{1}".format(aci_rn, contract), | ||
module_object=contract, | ||
target_filter={aci_name: contract}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is class query working? else try adding rootclass /subclass1/2 together since they are static values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will have to test this
aci.get_existing() | ||
|
||
if state == "present": | ||
child_configs = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why define child_configs here as []?
# Test code for the ACI modules | ||
# Copyright: (c) 2024, Faiz Mohammad (@faizmoh) <[email protected]> | ||
|
||
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you convert to this format: https://github.com/CiscoDevNet/ansible-aci/blob/master/tests/integration/targets/aci_esg_to_contract/tasks/main.yml
state: present | ||
|
||
# CREATE INB | ||
- name: bind inb contract to inband epg - check mode works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert defaults and test all attributes can be updates that can be updated
-) Added node_mgmt_epg_to_contract module
-) Test.yml still pending, working on it.
DCNE-87