Updated Avi Modules with new features and documentation update. (#34206)

* Updated Avi Modules with following
1. Support to perform patch operation using the modules. The data update method is
selected using avi_api_update_method=patch and patch operation is determined by
avi_api_patch_op. The patch data is the normal params that are provided in the modules

2. Support for avi_credentials as single authentication dictionary for all API calls.
This is preferred way as opposed to previously all credentials details would pollute
the individual Ansible tasks. It also allows the module development to be enhanced
without breaking compatibility for new authentication schemes like SAML etc.

3. Support for sharing api_context between the module invocations. This is a
workaround to not do multiple logins to Avi Controller and be able to
re-use single login across multiple REST API calls.

4. Documentation update for new parameters and existing ones with Units data.

* Fixed the pylint and pep8 errors caused due to pycharm editor auto formatting
This commit is contained in:
Gaurav Rastogi
2017-12-24 00:15:23 -08:00
committed by John R Barker
parent 9b4a1ed475
commit 9e2ff3e4d5
57 changed files with 1522 additions and 238 deletions

View File

@@ -43,7 +43,19 @@ options:
description:
- The state that should be applied on the entity.
default: present
choices: ["absent","present"]
choices: ["absent", "present"]
avi_api_update_method:
description:
- Default method for object update is HTTP PUT.
- Setting to patch will override that behavior to use HTTP PATCH.
version_added: "2.5"
default: put
choices: ["put", "patch"]
avi_api_patch_op:
description:
- Patch operation to use when using avi_api_update_method as patch.
version_added: "2.5"
choices: ["add", "replace", "delete"]
apic_configuration:
description:
- Apicconfiguration settings for cloud.
@@ -54,9 +66,18 @@ options:
aws_configuration:
description:
- Awsconfiguration settings for cloud.
azure_configuration:
description:
- Field introduced in 17.2.1.
version_added: "2.5"
cloudstack_configuration:
description:
- Cloudstackconfiguration settings for cloud.
custom_tags:
description:
- Custom tags for all avi created resources in the cloud infrastructure.
- Field introduced in 17.1.5.
version_added: "2.5"
dhcp_enabled:
description:
- Select the ip address management scheme.
@@ -87,11 +108,18 @@ options:
description:
- Ipam profile for the cloud.
- It is a reference to an object of type ipamdnsproviderprofile.
license_tier:
description:
- Specifies the default license tier which would be used by new se groups.
- This field by default inherits the value from system configuration.
- Enum options - ENTERPRISE_16, ENTERPRISE_18.
- Field introduced in 17.2.5.
version_added: "2.5"
license_type:
description:
- If no license type is specified then default license enforcement for the cloud type is chosen.
- The default mappings are container cloud is max ses, openstack and vmware is cores and linux it is sockets.
- Enum options - LIC_BACKEND_SERVERS, LIC_SOCKETS, LIC_CORES, LIC_HOSTS.
- Enum options - LIC_BACKEND_SERVERS, LIC_SOCKETS, LIC_CORES, LIC_HOSTS, LIC_SE_BANDWIDTH.
linuxserver_configuration:
description:
- Linuxserverconfiguration settings for cloud.
@@ -102,6 +130,7 @@ options:
description:
- Mtu setting for the cloud.
- Default value when not specified in API or module is interpreted by Avi Controller as 1500.
- Units(BYTES).
name:
description:
- Name of the object.
@@ -130,6 +159,12 @@ options:
rancher_configuration:
description:
- Rancherconfiguration settings for cloud.
state_based_dns_registration:
description:
- Dns records for vips are added/deleted based on the operational state of the vips.
- Field introduced in 17.1.12.
- Default value when not specified in API or module is interpreted by Avi Controller as True.
version_added: "2.5"
tenant_ref:
description:
- It is a reference to an object of type tenant.
@@ -149,20 +184,19 @@ options:
description:
- Cloud type.
- Enum options - CLOUD_NONE, CLOUD_VCENTER, CLOUD_OPENSTACK, CLOUD_AWS, CLOUD_VCA, CLOUD_APIC, CLOUD_MESOS, CLOUD_LINUXSERVER, CLOUD_DOCKER_UCP,
- CLOUD_RANCHER, CLOUD_OSHIFT_K8S.
- CLOUD_RANCHER, CLOUD_OSHIFT_K8S, CLOUD_AZURE.
- Default value when not specified in API or module is interpreted by Avi Controller as CLOUD_NONE.
required: true
extends_documentation_fragment:
- avi
'''
EXAMPLES = '''
- name: Create a VMware cloud with write access mode
EXAMPLES = """
- name: Create a VMWare cloud with write access mode
avi_cloud:
username: ''
controller: ''
password: ''
username: '{{ username }}'
controller: '{{ controller }}'
password: '{{ password }}'
apic_mode: false
dhcp_enabled: true
enable_vip_static_routes: false
@@ -179,7 +213,8 @@ EXAMPLES = '''
username: user
vcenter_url: 10.10.20.100
vtype: CLOUD_VCENTER
'''
"""
RETURN = '''
obj:
description: Cloud (api/cloud) object
@@ -199,10 +234,15 @@ def main():
argument_specs = dict(
state=dict(default='present',
choices=['absent', 'present']),
avi_api_update_method=dict(default='put',
choices=['put', 'patch']),
avi_api_patch_op=dict(choices=['add', 'replace', 'delete']),
apic_configuration=dict(type='dict',),
apic_mode=dict(type='bool',),
aws_configuration=dict(type='dict',),
azure_configuration=dict(type='dict',),
cloudstack_configuration=dict(type='dict',),
custom_tags=dict(type='list',),
dhcp_enabled=dict(type='bool',),
dns_provider_ref=dict(type='str',),
docker_configuration=dict(type='dict',),
@@ -210,6 +250,7 @@ def main():
east_west_ipam_provider_ref=dict(type='str',),
enable_vip_static_routes=dict(type='bool',),
ipam_provider_ref=dict(type='str',),
license_tier=dict(type='str',),
license_type=dict(type='str',),
linuxserver_configuration=dict(type='dict',),
mesos_configuration=dict(type='dict',),
@@ -222,6 +263,7 @@ def main():
prefer_static_routes=dict(type='bool',),
proxy_configuration=dict(type='dict',),
rancher_configuration=dict(type='dict',),
state_based_dns_registration=dict(type='bool',),
tenant_ref=dict(type='str',),
url=dict(type='str',),
uuid=dict(type='str',),