diff --git a/plugins/module_utils/mso.py b/plugins/module_utils/mso.py index 732e38af..fb1155dd 100644 --- a/plugins/module_utils/mso.py +++ b/plugins/module_utils/mso.py @@ -105,10 +105,10 @@ def mso_subnet_spec(): return dict( subnet=dict(type='str', required=True, aliases=['ip']), description=dict(type='str'), - scope=dict(type='str', choices=['private', 'public']), - shared=dict(type='bool'), - no_default_gateway=dict(type='bool'), - querier=dict(type='bool'), + scope=dict(type='str', default='private', choices=['private', 'public']), + shared=dict(type='bool', default=False), + no_default_gateway=dict(type='bool', default=False), + querier=dict(type='bool', default=False), ) @@ -588,13 +588,15 @@ def make_subnets(self, data): for subnet in data: if 'subnet' in subnet: subnet['ip'] = subnet.get('subnet') + if subnet.get('description') is None: + subnet['description'] = subnet.get('subnet') subnets.append(dict( ip=subnet.get('ip'), - description=str(subnet.get('description', subnet.get('ip'))), - scope=subnet.get('scope', 'private'), - shared=subnet.get('shared', False), - noDefaultGateway=subnet.get('no_default_gateway', False), - querier=subnet.get('querier', False), + description=str(subnet.get('description')), + scope=subnet.get('scope'), + shared=subnet.get('shared'), + noDefaultGateway=subnet.get('no_default_gateway'), + querier=subnet.get('querier'), )) return subnets diff --git a/plugins/modules/mso_label.py b/plugins/modules/mso_label.py index 6e9c9660..f2e1fd6d 100644 --- a/plugins/modules/mso_label.py +++ b/plugins/modules/mso_label.py @@ -19,7 +19,6 @@ - Manage labels on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: label: description: diff --git a/plugins/modules/mso_role.py b/plugins/modules/mso_role.py index 7d8be8cc..69ad4fe7 100644 --- a/plugins/modules/mso_role.py +++ b/plugins/modules/mso_role.py @@ -19,7 +19,6 @@ - Manage roles on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: role: description: diff --git a/plugins/modules/mso_schema.py b/plugins/modules/mso_schema.py index 94e80c16..89fa5814 100644 --- a/plugins/modules/mso_schema.py +++ b/plugins/modules/mso_schema.py @@ -19,7 +19,6 @@ - Manage schemas on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site.py b/plugins/modules/mso_schema_site.py index 9366504a..cbda9af7 100644 --- a/plugins/modules/mso_schema_site.py +++ b/plugins/modules/mso_schema_site.py @@ -19,7 +19,6 @@ - Manage sites on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_anp.py b/plugins/modules/mso_schema_site_anp.py index 301cab1d..d000cf84 100644 --- a/plugins/modules/mso_schema_site_anp.py +++ b/plugins/modules/mso_schema_site_anp.py @@ -19,7 +19,6 @@ - Manage site-local ANPs in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_anp_epg.py b/plugins/modules/mso_schema_site_anp_epg.py index aa206473..aeb19d88 100644 --- a/plugins/modules/mso_schema_site_anp_epg.py +++ b/plugins/modules/mso_schema_site_anp_epg.py @@ -19,7 +19,6 @@ - Manage site-local EPGs in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_anp_epg_domain.py b/plugins/modules/mso_schema_site_anp_epg_domain.py index 9c5df5af..c9780a16 100644 --- a/plugins/modules/mso_schema_site_anp_epg_domain.py +++ b/plugins/modules/mso_schema_site_anp_epg_domain.py @@ -19,7 +19,6 @@ - Manage site-local EPG domains in schema template on Cisco ACI Multi-Site. author: - Nirav Katarmal (@nkatarmal-crest) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_anp_epg_staticleaf.py b/plugins/modules/mso_schema_site_anp_epg_staticleaf.py index 7894a5a9..ac70162f 100644 --- a/plugins/modules/mso_schema_site_anp_epg_staticleaf.py +++ b/plugins/modules/mso_schema_site_anp_epg_staticleaf.py @@ -19,7 +19,6 @@ - Manage site-local EPG static leafs in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_anp_epg_staticport.py b/plugins/modules/mso_schema_site_anp_epg_staticport.py index 2609051f..ccf375e6 100644 --- a/plugins/modules/mso_schema_site_anp_epg_staticport.py +++ b/plugins/modules/mso_schema_site_anp_epg_staticport.py @@ -19,7 +19,6 @@ - Manage site-local EPG static ports in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_anp_epg_subnet.py b/plugins/modules/mso_schema_site_anp_epg_subnet.py index ade472f8..3e22bcac 100644 --- a/plugins/modules/mso_schema_site_anp_epg_subnet.py +++ b/plugins/modules/mso_schema_site_anp_epg_subnet.py @@ -19,7 +19,6 @@ - Manage site-local EPG subnets in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: @@ -60,6 +59,7 @@ description: - The scope of the subnet. type: str + default: private choices: [ private, public ] shared: description: diff --git a/plugins/modules/mso_schema_site_bd.py b/plugins/modules/mso_schema_site_bd.py index ad947a23..f466170e 100644 --- a/plugins/modules/mso_schema_site_bd.py +++ b/plugins/modules/mso_schema_site_bd.py @@ -19,7 +19,6 @@ - Manage site-local BDs in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_bd_l3out.py b/plugins/modules/mso_schema_site_bd_l3out.py index 26160ab7..b59e8704 100644 --- a/plugins/modules/mso_schema_site_bd_l3out.py +++ b/plugins/modules/mso_schema_site_bd_l3out.py @@ -19,7 +19,6 @@ - Manage site-local BDs l3out's in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_bd_subnet.py b/plugins/modules/mso_schema_site_bd_subnet.py index fddd5cd1..727d21ae 100644 --- a/plugins/modules/mso_schema_site_bd_subnet.py +++ b/plugins/modules/mso_schema_site_bd_subnet.py @@ -19,7 +19,6 @@ - Manage site-local BD subnets in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: @@ -55,6 +54,7 @@ description: - The scope of the subnet. type: str + default: private choices: [ private, public ] shared: description: diff --git a/plugins/modules/mso_schema_site_vrf.py b/plugins/modules/mso_schema_site_vrf.py index a4f6daca..5815abd9 100644 --- a/plugins/modules/mso_schema_site_vrf.py +++ b/plugins/modules/mso_schema_site_vrf.py @@ -19,7 +19,6 @@ - Manage site-local VRFs in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_vrf_region.py b/plugins/modules/mso_schema_site_vrf_region.py index 8325cbea..e7326ab7 100644 --- a/plugins/modules/mso_schema_site_vrf_region.py +++ b/plugins/modules/mso_schema_site_vrf_region.py @@ -19,7 +19,6 @@ - Manage site-local VRF regions in schema template on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_vrf_region_cidr.py b/plugins/modules/mso_schema_site_vrf_region_cidr.py index e214bcd4..1f2dea5a 100644 --- a/plugins/modules/mso_schema_site_vrf_region_cidr.py +++ b/plugins/modules/mso_schema_site_vrf_region_cidr.py @@ -21,7 +21,6 @@ author: - Dag Wieers (@dagwieers) - Lionel Hercot (@lhercot) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_site_vrf_region_cidr_subnet.py b/plugins/modules/mso_schema_site_vrf_region_cidr_subnet.py index d135a5bd..c1fd08bc 100644 --- a/plugins/modules/mso_schema_site_vrf_region_cidr_subnet.py +++ b/plugins/modules/mso_schema_site_vrf_region_cidr_subnet.py @@ -21,7 +21,6 @@ author: - Dag Wieers (@dagwieers) - Lionel Hercot (@lhercot) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template.py b/plugins/modules/mso_schema_template.py index 6fd7646f..f3f3d507 100644 --- a/plugins/modules/mso_schema_template.py +++ b/plugins/modules/mso_schema_template.py @@ -19,7 +19,6 @@ - Manage templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: tenant: description: diff --git a/plugins/modules/mso_schema_template_anp.py b/plugins/modules/mso_schema_template_anp.py index b2160aa8..1d0deb27 100644 --- a/plugins/modules/mso_schema_template_anp.py +++ b/plugins/modules/mso_schema_template_anp.py @@ -19,7 +19,6 @@ - Manage ANPs in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template_anp_epg.py b/plugins/modules/mso_schema_template_anp_epg.py index 380b48a7..963da210 100644 --- a/plugins/modules/mso_schema_template_anp_epg.py +++ b/plugins/modules/mso_schema_template_anp_epg.py @@ -19,7 +19,6 @@ - Manage EPGs in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: @@ -69,7 +68,6 @@ - The template that defines the referenced BD. type: str vrf: - version_added: '0.0.1' description: - The VRF associated to this ANP. type: dict @@ -108,6 +106,7 @@ description: - The scope of the subnet. type: str + default: private choices: [ private, public ] shared: description: @@ -150,7 +149,6 @@ - Whether this EPG is added to preferred group or not. - When not specified, this parameter defaults to C(no). type: bool - version_added: 0.0.1 state: description: - Use C(present) or C(absent) for adding or removing. @@ -351,6 +349,7 @@ def main(): elif state == 'present': bd_ref = mso.make_reference(bd, 'bd', schema_id, template) vrf_ref = mso.make_reference(vrf, 'vrf', schema_id, template) + mso.stdout = str(subnets) subnets = mso.make_subnets(subnets) if display_name is None and not mso.existing: diff --git a/plugins/modules/mso_schema_template_anp_epg_contract.py b/plugins/modules/mso_schema_template_anp_epg_contract.py index b13df418..b9c87d55 100644 --- a/plugins/modules/mso_schema_template_anp_epg_contract.py +++ b/plugins/modules/mso_schema_template_anp_epg_contract.py @@ -19,7 +19,6 @@ - Manage EPG contracts in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template_anp_epg_subnet.py b/plugins/modules/mso_schema_template_anp_epg_subnet.py index 924440c0..effe1b27 100644 --- a/plugins/modules/mso_schema_template_anp_epg_subnet.py +++ b/plugins/modules/mso_schema_template_anp_epg_subnet.py @@ -19,7 +19,6 @@ - Manage EPG subnets in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: @@ -55,6 +54,7 @@ description: - The scope of the subnet. type: str + default: private choices: [ private, public ] shared: description: diff --git a/plugins/modules/mso_schema_template_bd.py b/plugins/modules/mso_schema_template_bd.py index 88296031..8a195899 100644 --- a/plugins/modules/mso_schema_template_bd.py +++ b/plugins/modules/mso_schema_template_bd.py @@ -19,7 +19,6 @@ - Manage BDs in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: @@ -108,6 +107,7 @@ description: - The scope of the subnet. type: str + default: private choices: [ private, public ] shared: description: diff --git a/plugins/modules/mso_schema_template_bd_subnet.py b/plugins/modules/mso_schema_template_bd_subnet.py index 8178b700..be202826 100644 --- a/plugins/modules/mso_schema_template_bd_subnet.py +++ b/plugins/modules/mso_schema_template_bd_subnet.py @@ -19,7 +19,6 @@ - Manage BD subnets in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: @@ -50,6 +49,7 @@ description: - The scope of the subnet. type: str + default: private choices: [ private, public ] shared: description: diff --git a/plugins/modules/mso_schema_template_contract_filter.py b/plugins/modules/mso_schema_template_contract_filter.py index 104ba917..8942d2d1 100644 --- a/plugins/modules/mso_schema_template_contract_filter.py +++ b/plugins/modules/mso_schema_template_contract_filter.py @@ -19,7 +19,6 @@ - Manage contract filters in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template_deploy.py b/plugins/modules/mso_schema_template_deploy.py index a09c65e9..f852be4f 100644 --- a/plugins/modules/mso_schema_template_deploy.py +++ b/plugins/modules/mso_schema_template_deploy.py @@ -19,7 +19,6 @@ - Deploy schema templates to sites. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template_external_epg.py b/plugins/modules/mso_schema_template_external_epg.py index 0c06ccab..38065c40 100644 --- a/plugins/modules/mso_schema_template_external_epg.py +++ b/plugins/modules/mso_schema_template_external_epg.py @@ -19,7 +19,6 @@ - Manage external EPGs in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template_filter_entry.py b/plugins/modules/mso_schema_template_filter_entry.py index 9d762ff4..eea422e3 100644 --- a/plugins/modules/mso_schema_template_filter_entry.py +++ b/plugins/modules/mso_schema_template_filter_entry.py @@ -19,7 +19,6 @@ - Manage filter entries in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template_l3out.py b/plugins/modules/mso_schema_template_l3out.py index 32c2da8e..be315af7 100644 --- a/plugins/modules/mso_schema_template_l3out.py +++ b/plugins/modules/mso_schema_template_l3out.py @@ -19,7 +19,6 @@ - Manage l3outs in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_schema_template_vrf.py b/plugins/modules/mso_schema_template_vrf.py index 7e54655e..7e7367e0 100644 --- a/plugins/modules/mso_schema_template_vrf.py +++ b/plugins/modules/mso_schema_template_vrf.py @@ -19,7 +19,6 @@ - Manage VRFs in schema templates on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: schema: description: diff --git a/plugins/modules/mso_site.py b/plugins/modules/mso_site.py index 4b84f70b..2b6cf82f 100644 --- a/plugins/modules/mso_site.py +++ b/plugins/modules/mso_site.py @@ -19,7 +19,6 @@ - Manage sites on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: apic_password: description: diff --git a/plugins/modules/mso_tenant.py b/plugins/modules/mso_tenant.py index 2e8d3627..68f54290 100644 --- a/plugins/modules/mso_tenant.py +++ b/plugins/modules/mso_tenant.py @@ -20,7 +20,6 @@ - Manage tenants on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: tenant: description: diff --git a/plugins/modules/mso_user.py b/plugins/modules/mso_user.py index 2cfb9eea..77f8bf93 100644 --- a/plugins/modules/mso_user.py +++ b/plugins/modules/mso_user.py @@ -19,7 +19,6 @@ - Manage users on Cisco ACI Multi-Site. author: - Dag Wieers (@dagwieers) -version_added: '0.0.1' options: user: description: @@ -65,7 +64,6 @@ - The roles for this user and their access types (read or write). - Access type defaults to C(write). type: list - elements: str state: description: - Use C(present) or C(absent) for adding or removing. @@ -171,7 +169,7 @@ def main(): # TODO: What possible options do we have ? account_status=dict(type='str', choices=['active', 'inactive']), domain=dict(type='str'), - roles=dict(type='list', elements='str'), + roles=dict(type='list'), state=dict(type='str', default='present', choices=['absent', 'present', 'query']), ) diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 69585f78..1326ec6a 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1 +1,2 @@ -plugins/modules/mso_schema_template_bd.py validate-modules:invalid-ansiblemodule-schema \ No newline at end of file +plugins/modules/mso_schema_template_bd.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/mso_user.py validate-modules:parameter-list-no-elements \ No newline at end of file