diff --git a/plugins/modules/mso_schema_site_bd_l3out.py b/plugins/modules/mso_schema_site_bd_l3out.py index 17391e56..3c2d9173 100644 --- a/plugins/modules/mso_schema_site_bd_l3out.py +++ b/plugins/modules/mso_schema_site_bd_l3out.py @@ -173,7 +173,9 @@ def main(): site=dict(type="str", required=True), template=dict(type="str", required=True), bd=dict(type="str", required=True), - l3out=dict(type="dict", options=mso_l3out_reference_spec(), aliases=["name"]), # This parameter is not required for querying all objects + l3out=dict( + type="dict", options=mso_l3out_reference_spec(), aliases=["name"], mutually_exclusive=[("tenant", "schema"), ("tenant", "template")] + ), # This parameter is not required for querying all objects state=dict(type="str", default="present", choices=["absent", "present", "query"]), ) @@ -207,9 +209,6 @@ def main(): if l3out: - if l3out.get("tenant") and (l3out.get("schema") or l3out.get("template")): - module.fail_json(msg="L3out tenant cannot be specified in combination with schema or template") - if l3out.get("tenant"): l3out_ref = "uni/tn-{0}/out-{1}".format(l3out.get("tenant"), l3out.get("name")) else: diff --git a/tests/integration/targets/mso_schema_site_bd_l3out/tasks/main.yml b/tests/integration/targets/mso_schema_site_bd_l3out/tasks/main.yml index 35eac554..6ae17044 100644 --- a/tests/integration/targets/mso_schema_site_bd_l3out/tasks/main.yml +++ b/tests/integration/targets/mso_schema_site_bd_l3out/tasks/main.yml @@ -597,11 +597,11 @@ - nm_remove_l3out_on_apic.previous.tenant == "ansible_test" - nm_remove_l3out_on_apic.current == {} - nm_create_l3out_schema_error is failed - - nm_create_l3out_schema_error.msg == "L3out tenant cannot be specified in combination with schema or template" + - nm_create_l3out_schema_error.msg == "parameters are mutually exclusive{{":"}} tenant|schema found in l3out" - nm_create_l3out_template_error is failed - - nm_create_l3out_template_error.msg == "L3out tenant cannot be specified in combination with schema or template" + - nm_create_l3out_template_error.msg == "parameters are mutually exclusive{{":"}} tenant|template found in l3out" - nm_create_l3out_both_error is failed - - nm_create_l3out_both_error.msg == "L3out tenant cannot be specified in combination with schema or template" + - nm_create_l3out_both_error.msg == "parameters are mutually exclusive{{":"}} tenant|schema, tenant|template found in l3out" always: