diff --git a/plugins/modules/aci_cloud_subnet.py b/plugins/modules/aci_cloud_subnet.py index 6855a6df9..bfdad0a33 100644 --- a/plugins/modules/aci_cloud_subnet.py +++ b/plugins/modules/aci_cloud_subnet.py @@ -59,19 +59,19 @@ aws_availability_zone: description: - The cloud zone which is attached to the given cloud context profile. - - Only used when it is an AWS cloud apic. + - Only used when it is an AWS Cloud APIC. type: str aliases: [availability_zone, av_zone, zone] vnet_gateway: description: - Determine if a vNet Gateway Router will be deployed or not. - - Only used when it is an Azure cloud apic. + - Only used when it is an Azure Cloud APIC. type: bool default: false azure_region: description: - The Azure cloud region to attach this subnet to. - - Only used when it is an Azure cloud apic. + - Only used when it is an Azure Cloud APIC. type: str aliases: [az_region] state: @@ -273,6 +273,7 @@ def main(): ["state", "absent", ["tenant", "cloud_context_profile", "cidr", "address"]], ["state", "present", ["tenant", "cloud_context_profile", "cidr", "address"]], ], + mutually_exclusive=[("aws_availability_zone", "azure_region")], ) name = module.params.get("name") @@ -288,9 +289,6 @@ def main(): azure_region = module.params.get("azure_region") child_configs = [] - if aws_availability_zone and azure_region: - module.fail_json(msg="Configuring both an AWS availability zone and an Azure region is invalid.") - aci = ACIModule(module) aci.construct_url( root_class=dict(aci_class="fvTenant", aci_rn="tn-{0}".format(tenant), target_filter='eq(fvTenant.name, "{0}")'.format(tenant), module_object=tenant), diff --git a/tests/integration/targets/aci_cloud_subnet/tasks/main.yml b/tests/integration/targets/aci_cloud_subnet/tasks/main.yml index 7db54a4ec..8e6a9a15a 100644 --- a/tests/integration/targets/aci_cloud_subnet/tasks/main.yml +++ b/tests/integration/targets/aci_cloud_subnet/tasks/main.yml @@ -126,7 +126,7 @@ - nm_add_subnet_again.previous.0.cloudSubnet.attributes.dn == "uni/tn-ansible_test/ctxprofile-ctx_profile_1/cidr-[10.50.0.0/16]/subnet-[10.50.0.1]" - nm_add_subnet_again.previous.0.cloudSubnet.attributes.annotation == "orchestrator:ansible" - nm_add_subnet_again.previous.0.cloudSubnet.attributes.scope == "private" - - nm_invalid_subnet_zone.msg == "Configuring both an AWS availability zone and an Azure region is invalid." + - nm_invalid_subnet_zone.msg == "parameters are mutually exclusive{{":"}} aws_availability_zone|azure_region" - name: Verify create tasks for Azure ansible.builtin.assert: