From 585862e4d05d621bd6681c7c510135b9c58c823a Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Fri, 19 Jan 2018 18:04:30 +0100 Subject: [PATCH] ACI: Added more VMM providers, doc improvements (#34879) * Added more VMM providers, doc improvements This fixes #34211 and others * Add all VMM providers to other domain-related modules --- .../modules/network/aci/aci_aep_to_domain.py | 7 +++++-- lib/ansible/modules/network/aci/aci_domain.py | 15 +++++++++------ .../network/aci/aci_domain_to_encap_pool.py | 7 +++++-- .../network/aci/aci_domain_to_vlan_pool.py | 4 ++-- .../modules/network/aci/aci_epg_to_domain.py | 16 ++++++++++------ 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/lib/ansible/modules/network/aci/aci_aep_to_domain.py b/lib/ansible/modules/network/aci/aci_aep_to_domain.py index f3232df717e..79fe107c65b 100755 --- a/lib/ansible/modules/network/aci/aci_aep_to_domain.py +++ b/lib/ansible/modules/network/aci/aci_aep_to_domain.py @@ -48,7 +48,7 @@ options: vm_provider: description: - The VM platform for VMM Domains. - choices: [ microsoft, openstack, vmware ] + choices: [ cloudfoundry, kubernetes, microsoft, openshift, openstack, redhat, vmware ] extends_documentation_fragment: aci ''' @@ -60,7 +60,10 @@ from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec from ansible.module_utils.basic import AnsibleModule VM_PROVIDER_MAPPING = dict( + cloudfoundry='CloudFoundry', + kubernetes='Kubernetes', microsoft='Microsoft', + openshift='OpenShift', openstack='OpenStack', redhat='Redhat', vmware='VMware', @@ -74,7 +77,7 @@ def main(): domain=dict(type='str', aliases=['domain_name', 'domain_profile']), domain_type=dict(type='str', choices=['fc', 'l2dom', 'l3dom', 'phys', 'vmm'], aliases=['type']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']), - vm_provider=dict(type='str', choices=['microsoft', 'openstack', 'redhat', 'vmware']), + vm_provider=dict(type='str', choices=['cloudfoundry', 'kubernetes', 'microsoft', 'openshift', 'openstack', 'redhat', 'vmware']), ) module = AnsibleModule( diff --git a/lib/ansible/modules/network/aci/aci_domain.py b/lib/ansible/modules/network/aci/aci_domain.py index 7fe5d435c07..f08f8be57d0 100644 --- a/lib/ansible/modules/network/aci/aci_domain.py +++ b/lib/ansible/modules/network/aci/aci_domain.py @@ -59,7 +59,7 @@ options: vm_provider: description: - The VM platform for VMM Domains. - choices: [ microsoft, openstack, redhat, vmware ] + choices: [ cloudfoundry, kubernetes, microsoft, openshift, openstack, redhat, vmware ] vswitch: description: - The virtual switch to use for vmm domains. @@ -130,10 +130,13 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec VM_PROVIDER_MAPPING = dict( - microsoft="Microsoft", - openstack="OpenStack", - redhat="Redhat", - vmware="VMware", + cloudfoundry='CloudFoundry', + kubernetes='Kubernetes', + microsoft='Microsoft', + openshift='OpenShift', + openstack='OpenStack', + redhat='Redhat', + vmware='VMware', ) VSWITCH_MAPPING = dict( avs='n1kv', @@ -155,7 +158,7 @@ def main(): encap_mode=dict(type='str', choices=['unknown', 'vlan', 'vxlan']), multicast_address=dict(type='str'), state=dict(type='str', default='present', choices=['absent', 'present', 'query']), - vm_provider=dict(type='str', choices=['microsoft', 'openstack', 'redhat', 'vmware']), + vm_provider=dict(type='str', choices=['cloudfoundry', 'kubernetes', 'microsoft', 'openshift', 'openstack', 'redhat', 'vmware']), vswitch=dict(type='str', choices=['avs', 'default', 'dvs', 'unknown']), ) diff --git a/lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py b/lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py index 43e2732ecd9..79058b0c1b9 100644 --- a/lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py +++ b/lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py @@ -58,7 +58,7 @@ options: vm_provider: description: - The VM platform for VMM Domains. - choices: [ microsoft, openstack, redhat, vmware ] + choices: [ cloudfoundry, kubernetes, microsoft, openshift, openstack, redhat, vmware ] extends_documentation_fragment: aci ''' @@ -70,7 +70,10 @@ from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec from ansible.module_utils.basic import AnsibleModule VM_PROVIDER_MAPPING = dict( + cloudfoundry='CloudFoundry', + kubernetes='Kubernetes', microsoft='Microsoft', + openshift='OpenShift', openstack='OpenStack', redhat='Redhat', vmware='VMware', @@ -98,7 +101,7 @@ def main(): pool_allocation_mode=dict(type='str', aliases=['allocation_mode', 'mode'], choices=['dynamic', 'static']), pool_type=dict(type='str', required=True, choices=['vlan', 'vsan', 'vxlan']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']), - vm_provider=dict(type='str', choices=['microsoft', 'openstack', 'redhat', 'vmware']), + vm_provider=dict(type='str', choices=['cloudfoundry', 'kubernetes', 'microsoft', 'openshift', 'openstack', 'redhat', 'vmware']), ) module = AnsibleModule( diff --git a/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py b/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py index 176c101ce46..4f35b1a2d12 100755 --- a/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py +++ b/lib/ansible/modules/network/aci/aci_domain_to_vlan_pool.py @@ -53,7 +53,7 @@ options: vm_provider: description: - The VM platform for VMM Domains. - choices: [ microsoft, openstack, redhat, vmware ] + choices: [ cloudfoundry, kubernetes, microsoft, openshift, openstack, redhat, vmware ] extends_documentation_fragment: aci ''' @@ -144,7 +144,7 @@ def main(): pool=dict(type='str', aliases=['pool_name', 'vlan_pool']), pool_allocation_mode=dict(type='str', required=True, aliases=['allocation_mode', 'mode'], choices=['dynamic', 'static']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']), - vm_provider=dict(type='str', choices=['microsoft', 'openstack', 'redhat', 'vmware']), + vm_provider=dict(type='str', choices=['cloudfoundry', 'kubernetes', 'microsoft', 'openshift', 'openstack', 'redhat', 'vmware']), ) module = AnsibleModule( diff --git a/lib/ansible/modules/network/aci/aci_epg_to_domain.py b/lib/ansible/modules/network/aci/aci_epg_to_domain.py index d483fd5a9c3..c1b72e1207e 100644 --- a/lib/ansible/modules/network/aci/aci_epg_to_domain.py +++ b/lib/ansible/modules/network/aci/aci_epg_to_domain.py @@ -94,7 +94,7 @@ options: vm_provider: description: - The VM platform for VMM Domains. - choices: [ microsoft, openstack, vmware ] + choices: [ cloudfoundry, kubernetes, microsoft, openshift, openstack, redhat, vmware ] extends_documentation_fragment: aci ''' @@ -106,9 +106,13 @@ from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec from ansible.module_utils.basic import AnsibleModule VM_PROVIDER_MAPPING = dict( - microsoft="uni/vmmp-Microsoft/dom-", - openstack="uni/vmmp-OpenStack/dom-", - vmware="uni/vmmp-VMware/dom-", + cloudfoundry='CloudFoundry', + kubernetes='Kubernetes', + microsoft='Microsoft', + openshift='OpenShift', + openstack='OpenStack', + redhat='Redhat', + vmware='VMware', ) @@ -128,7 +132,7 @@ def main(): resolution_immediacy=dict(type='str', choices=['immediate', 'lazy', 'pre-provision']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']), tenant=dict(type='str', aliases=['tenant_name']), - vm_provider=dict(type='str', choices=['microsoft', 'openstack', 'vmware']), + vm_provider=dict(type='str', choices=['cloudfoundry', 'kubernetes', 'microsoft', 'openshift', 'openstack', 'redhat', 'vmware']), method=dict(type='str', choices=['delete', 'get', 'post'], aliases=['action'], removed_in_version='2.6'), # Deprecated starting from v2.6 protocol=dict(type='str', removed_in_version='2.6'), # Deprecated in v2.6 ) @@ -173,7 +177,7 @@ def main(): # Compile the full domain for URL building if domain_type == 'vmm': - epg_domain = '{0}{1}'.format(VM_PROVIDER_MAPPING[vm_provider], domain) + epg_domain = 'uni/vmmp-{0}/dom-{1}'.format(VM_PROVIDER_MAPPING[vm_provider], domain) elif domain_type is not None: epg_domain = 'uni/phys-{0}'.format(domain) else: