diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml index 9deff156..6a3e71b9 100644 --- a/.github/BOTMETA.yml +++ b/.github/BOTMETA.yml @@ -65,9 +65,6 @@ files: $module_utils/network/aruba/aruba.py: maintainers: $team_aruba labels: networking - $module_utils/network/avi/: - maintainers: $team_avi - labels: networking $module_utils/network/bigswitch/bigswitch.py: maintainers: jayakody tedelhourani vuile labels: networking @@ -139,24 +136,6 @@ files: authors: jmighion maintainers: $team_aruba ignore: jmighion - $modules/network/avi/: - authors: grastogi23 - maintainers: ericsysmin khaltore - $modules/network/avi/avi_api_version.py: - authors: vivobg - maintainers: $team_avi - $modules/network/avi/avi_autoscalelaunchconfig.py: - authors: chaitanyaavi - maintainers: $team_avi - $modules/network/avi/avi_l4policyset.py: - authors: chaitanyaavi - maintainers: $team_avi - $modules/network/avi/avi_user.py: - authors: gitshrikant - maintainers: $team_avi - $modules/network/avi/avi_useraccount.py: - authors: chaitanyaavi - maintainers: $team_avi $modules/network/bigswitch/: authors: tedelhourani maintainers: jayakody vuile @@ -363,7 +342,6 @@ macros: terminals: plugins/terminal team_aci: aciguru brunocalogero devarshishah3 fadallar jmcgill298 koladiya mtorelli rsmeyers schunduri smnmtzgr team_aruba: karthikeyan-dhandapani - team_avi: ericsysmin grastogi23 khaltore team_e_spirit: MatrixCrawler getjack team_edgeos: Qalthos samdoran jplitza virtualguy team_extreme: LindsayHill ujwalkomarla diff --git a/changelogs/fragments/avi-migration-removal.yml b/changelogs/fragments/avi-migration-removal.yml new file mode 100644 index 00000000..f42f6550 --- /dev/null +++ b/changelogs/fragments/avi-migration-removal.yml @@ -0,0 +1,12 @@ +removed_features: +- | + All ``avi`` modules have been removed from this collection. + They have been migrated to the `vmware.alb `_ collection. + If you use ansible-base 2.10 or newer, redirections have been provided. + If you use Ansible 2.9 and installed this collection, you need to adjust the FQCNs (``community.network.avi_pool`` → ``vmware.alb.avi_pool``) and make sure to install the `vmware.alb` collection. +breaking_changes: +- | + If you use Ansible 2.9 and the ``avi`` modules from this collection, community.network 2.0.0 results in errors when trying to use the avi content by FQCN, like ``community.network.avi_pool``. + Since Ansible 2.9 is not able to use redirections, you will have to adjust your playbooks and roles manually to use the new FQCNs (``vmware.alb.avi_pool`` for the previous example) and to make sure that you have ``vmware.alb`` installed. + If you use ansible-base 2.10 or newer and did not install Ansible 3.0.0, but installed (and/or upgraded) community.network manually, you need to make sure to also install ``vmware.alb`` if you are using any of the ``avi`` modules. + While ansible-base 2.10 or newer can use the redirects that community.network 2.0.0 adds, the collection they point to (vmware.alb) must be installed for them to work. \ No newline at end of file diff --git a/meta/runtime.yml b/meta/runtime.yml index 8c17caef..d5618e90 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -208,6 +208,136 @@ plugin_routing: redirect: community.routeros.command routeros_facts: redirect: community.routeros.facts + avi_actiongroupconfig: + redirect: vmware.alb.avi_actiongroupconfig + avi_alertconfig: + redirect: vmware.alb.avi_alertconfig + avi_alertemailconfig: + redirect: vmware.alb.avi_alertemailconfig + avi_alertscriptconfig: + redirect: vmware.alb.avi_alertscriptconfig + avi_alertsyslogconfig: + redirect: vmware.alb.avi_alertsyslogconfig + avi_analyticsprofile: + redirect: vmware.alb.avi_analyticsprofile + avi_api_session: + redirect: vmware.alb.avi_api_session + avi_api_version: + redirect: vmware.alb.avi_api_version + avi_applicationpersistenceprofile: + redirect: vmware.alb.avi_applicationpersistenceprofile + avi_applicationprofile: + redirect: vmware.alb.avi_applicationprofile + avi_authprofile: + redirect: vmware.alb.avi_authprofile + avi_autoscalelaunchconfig: + redirect: vmware.alb.avi_autoscalelaunchconfig + avi_backup: + redirect: vmware.alb.avi_backup + avi_backupconfiguration: + redirect: vmware.alb.avi_backupconfiguration + avi_certificatemanagementprofile: + redirect: vmware.alb.avi_certificatemanagementprofile + avi_cloud: + redirect: vmware.alb.avi_cloud + avi_cloudconnectoruser: + redirect: vmware.alb.avi_cloudconnectoruser + avi_cloudproperties: + redirect: vmware.alb.avi_cloudproperties + avi_cluster: + redirect: vmware.alb.avi_cluster + avi_clusterclouddetails: + redirect: vmware.alb.avi_clusterclouddetails + avi_controllerproperties: + redirect: vmware.alb.avi_controllerproperties + avi_customipamdnsprofile: + redirect: vmware.alb.avi_customipamdnsprofile + avi_dnspolicy: + redirect: vmware.alb.avi_dnspolicy + avi_errorpagebody: + redirect: vmware.alb.avi_errorpagebody + avi_errorpageprofile: + redirect: vmware.alb.avi_errorpageprofile + avi_gslb: + redirect: vmware.alb.avi_gslb + avi_gslbgeodbprofile: + redirect: vmware.alb.avi_gslbgeodbprofile + avi_gslbservice: + redirect: vmware.alb.avi_gslbservice + avi_gslbservice_patch_member: + redirect: vmware.alb.avi_gslbservice_patch_member + avi_hardwaresecuritymodulegroup: + redirect: vmware.alb.avi_hardwaresecuritymodulegroup + avi_healthmonitor: + redirect: vmware.alb.avi_healthmonitor + avi_httppolicyset: + redirect: vmware.alb.avi_httppolicyset + avi_ipaddrgroup: + redirect: vmware.alb.avi_ipaddrgroup + avi_ipamdnsproviderprofile: + redirect: vmware.alb.avi_ipamdnsproviderprofile + avi_l4policyset: + redirect: vmware.alb.avi_l4policyset + avi_microservicegroup: + redirect: vmware.alb.avi_microservicegroup + avi_network: + redirect: vmware.alb.avi_network + avi_networkprofile: + redirect: vmware.alb.avi_networkprofile + avi_networksecuritypolicy: + redirect: vmware.alb.avi_networksecuritypolicy + avi_pkiprofile: + redirect: vmware.alb.avi_pkiprofile + avi_pool: + redirect: vmware.alb.avi_pool + avi_poolgroup: + redirect: vmware.alb.avi_poolgroup + avi_poolgroupdeploymentpolicy: + redirect: vmware.alb.avi_poolgroupdeploymentpolicy + avi_prioritylabels: + redirect: vmware.alb.avi_prioritylabels + avi_role: + redirect: vmware.alb.avi_role + avi_scheduler: + redirect: vmware.alb.avi_scheduler + avi_seproperties: + redirect: vmware.alb.avi_seproperties + avi_serverautoscalepolicy: + redirect: vmware.alb.avi_serverautoscalepolicy + avi_serviceengine: + redirect: vmware.alb.avi_serviceengine + avi_serviceenginegroup: + redirect: vmware.alb.avi_serviceenginegroup + avi_snmptrapprofile: + redirect: vmware.alb.avi_snmptrapprofile + avi_sslkeyandcertificate: + redirect: vmware.alb.avi_sslkeyandcertificate + avi_sslprofile: + redirect: vmware.alb.avi_sslprofile + avi_stringgroup: + redirect: vmware.alb.avi_stringgroup + avi_systemconfiguration: + redirect: vmware.alb.avi_systemconfiguration + avi_tenant: + redirect: vmware.alb.avi_tenant + avi_trafficcloneprofile: + redirect: vmware.alb.avi_trafficcloneprofile + avi_user: + redirect: vmware.alb.avi_user + avi_useraccount: + redirect: vmware.alb.avi_useraccount + avi_useraccountprofile: + redirect: vmware.alb.avi_useraccountprofile + avi_virtualservice: + redirect: vmware.alb.avi_virtualservice + avi_vrfcontext: + redirect: vmware.alb.avi_vrfcontext + avi_vsdatascriptset: + redirect: vmware.alb.avi_vsdatascriptset + avi_vsvip: + redirect: vmware.alb.avi_vsvip + avi_webhook: + redirect: vmware.alb.avi_webhook httpapi: fortianalyzer: redirect: community.fortios.fortianalyzer @@ -222,6 +352,12 @@ plugin_routing: redirect: community.fortios.fortianalyzer.common network.fortianalyzer.fortianalyzer: redirect: community.fortios.fortianalyzer.fortianalyzer + network.avi.ansible_utils: + redirect: vmware.alb.ansible_utils + network.avi.avi: + redirect: vmware.alb.avi + network.avi.avi_api: + redirect: vmware.alb.avi_api cliconf: routeros: redirect: community.routeros.routeros @@ -236,3 +372,5 @@ plugin_routing: doc_fragments: nso: redirect: cisco.nso.nso + avi: + redirect: vmware.alb.avi diff --git a/plugins/doc_fragments/avi.py b/plugins/doc_fragments/avi.py deleted file mode 100644 index e4b5f898..00000000 --- a/plugins/doc_fragments/avi.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- coding: utf-8 -*- - -# Created on December 12, 2016 -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Avi Version: 16.3.4 -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - - -class ModuleDocFragment(object): - # Avi common documentation fragment - DOCUMENTATION = r''' -options: - controller: - description: - - IP address or hostname of the controller. The default value is the environment variable C(AVI_CONTROLLER). - type: str - default: '' - username: - description: - - Username used for accessing Avi controller. The default value is the environment variable C(AVI_USERNAME). - type: str - default: '' - password: - description: - - Password of Avi user in Avi controller. The default value is the environment variable C(AVI_PASSWORD). - type: str - default: '' - tenant: - description: - - Name of tenant used for all Avi API calls and context of object. - type: str - default: admin - tenant_uuid: - description: - - UUID of tenant used for all Avi API calls and context of object. - type: str - default: '' - api_version: - description: - - Avi API version of to use for Avi API and objects. - type: str - default: 16.4.4 - avi_credentials: - description: - - Avi Credentials dictionary which can be used in lieu of enumerating Avi Controller login details. - suboptions: - controller: - description: - - Avi controller IP or SQDN - username: - description: - - Avi controller username - password: - description: - - Avi controller password - api_version: - description: - - Avi controller version - default: 16.4.4 - tenant: - description: - - Avi controller tenant - default: admin - tenant_uuid: - description: - - Avi controller tenant UUID - port: - description: - - Avi controller port - token: - description: - - Avi controller API token - timeout: - description: - - Avi controller request timeout - default: 300 - session_id: - description: - - Avi controller API session id to reuse existing session with csrftoken - csrftoken: - description: - - Avi controller API csrftoken to reuse existing session with session id - type: dict - api_context: - description: - - Avi API context that includes current session ID and CSRF Token. - - This allows user to perform single login and re-use the session. - type: dict - avi_disable_session_cache_as_fact: - description: - - It disables avi session information to be cached as a fact. - type: bool - default: false - -notes: - - For more information on using Ansible to manage Avi Network devices see U(https://www.ansible.com/ansible-avi-networks). -''' diff --git a/plugins/lookup/avi.py b/plugins/lookup/avi.py deleted file mode 100644 index 625c8748..00000000 --- a/plugins/lookup/avi.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) Sandeep Bandi -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' -name: avi -author: Sandeep Bandi (@sabandi) -short_description: Look up ``Avi`` objects. -description: - - Given an object_type, fetch all the objects of that type or fetch - the specific object that matches the name/uuid given via options. - - For single object lookup. If you want the output to be a list, you may - want to pass option wantlist=True to the plugin. - -options: - obj_type: - description: - - type of object to query - required: True - obj_name: - description: - - name of the object to query - obj_uuid: - description: - - UUID of the object to query -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -# Lookup query for all the objects of a specific type. -- ansible.builtin.debug: msg="{{ lookup('community.network.avi', avi_credentials=avi_credentials, obj_type='virtualservice') }}" -# Lookup query for an object with the given name and type. -- ansible.builtin.debug: msg="{{ lookup('community.network.avi', avi_credentials=avi_credentials, obj_name='vs1', obj_type='virtualservice', wantlist=True) }}" -# Lookup query for an object with the given UUID and type. -- ansible.builtin.debug: msg="{{ lookup('community.network.avi', obj_uuid='virtualservice-5c0e183a-690a-45d8-8d6f-88c30a52550d', obj_type='virtualservice') }}" -# We can replace lookup with query function to always the get the output as list. -# This is helpful for looping. -- ansible.builtin.debug: msg="{{ query('community.network.avi', obj_uuid='virtualservice-5c0e183a-690a-45d8-8d6f-88c30a52550d', obj_type='virtualservice') }}" -""" - -RETURN = """ - _raw: - description: - - One ore more objects returned from ``Avi`` API. - type: list - elements: dictionary -""" - -from ansible.module_utils._text import to_native -from ansible.errors import AnsibleError, AnsibleParserError -from ansible.plugins.lookup import LookupBase -from ansible.utils.display import Display -from ansible_collections.community.network.plugins.module_utils.network.avi.avi_api import (ApiSession, - AviCredentials, - AviServerError, - ObjectNotFound, - APIError) - -display = Display() - - -def _api(avi_session, path, **kwargs): - ''' - Generic function to handle both // and / - API resource endpoints. - ''' - rsp = [] - try: - rsp_data = avi_session.get(path, **kwargs).json() - if 'results' in rsp_data: - rsp = rsp_data['results'] - else: - rsp.append(rsp_data) - except ObjectNotFound as e: - display.warning('Resource not found. Please check obj_name/' - 'obj_uuid/obj_type are spelled correctly.') - display.v(to_native(e)) - except (AviServerError, APIError) as e: - raise AnsibleError(to_native(e)) - except Exception as e: - # Generic excption handling for connection failures - raise AnsibleError('Unable to communicate with controller' - 'due to error: %s' % to_native(e)) - - return rsp - - -class LookupModule(LookupBase): - def run(self, terms, variables=None, avi_credentials=None, **kwargs): - - api_creds = AviCredentials(**avi_credentials) - # Create the session using avi_credentials - try: - avi = ApiSession(avi_credentials=api_creds) - except Exception as e: - raise AnsibleError(to_native(e)) - - # Return an empty list if the object is not found - rsp = [] - try: - path = kwargs.pop('obj_type') - except KeyError: - raise AnsibleError("Please pass the obj_type for lookup") - - if kwargs.get('obj_name', None): - name = kwargs.pop('obj_name') - try: - display.v("Fetching obj: %s of type: %s" % (name, path)) - rsp_data = avi.get_object_by_name(path, name, **kwargs) - if rsp_data: - # Append the return data only if it is not None. i.e object - # with specified name is present - rsp.append(rsp_data) - except AviServerError as e: - raise AnsibleError(to_native(e)) - elif kwargs.get('obj_uuid', None): - obj_uuid = kwargs.pop('obj_uuid') - obj_path = "%s/%s" % (path, obj_uuid) - display.v("Fetching obj: %s of type: %s" % (obj_uuid, path)) - rsp = _api(avi, obj_path, **kwargs) - else: - display.v("Fetching all objects of type: %s" % path) - rsp = _api(avi, path, **kwargs) - - return rsp diff --git a/plugins/module_utils/network/avi/__init__.py b/plugins/module_utils/network/avi/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/module_utils/network/avi/ansible_utils.py b/plugins/module_utils/network/avi/ansible_utils.py deleted file mode 100644 index 93de7943..00000000 --- a/plugins/module_utils/network/avi/ansible_utils.py +++ /dev/null @@ -1,574 +0,0 @@ -""" -Created on Aug 16, 2016 - -@author: Gaurav Rastogi (grastogi@avinetworks.com) -""" - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -import os -import re -import logging -import sys -from copy import deepcopy -from ansible.module_utils.basic import env_fallback - -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi_api import ( - ApiSession, ObjectNotFound, avi_sdk_syslog_logger, AviCredentials, HAS_AVI) -except ImportError: - HAS_AVI = False - - -if os.environ.get('AVI_LOG_HANDLER', '') != 'syslog': - log = logging.getLogger(__name__) -else: - # Ansible does not allow logging from the modules. - log = avi_sdk_syslog_logger() - - -def _check_type_string(x): - """ - :param x: - :return: True if it is of type string - """ - if isinstance(x, str): - return True - if sys.version_info[0] < 3: - try: - return isinstance(x, unicode) - except NameError: - return False - - -class AviCheckModeResponse(object): - """ - Class to support ansible check mode. - """ - - def __init__(self, obj, status_code=200): - self.obj = obj - self.status_code = status_code - - def json(self): - return self.obj - - -def ansible_return(module, rsp, changed, req=None, existing_obj=None, - api_context=None): - """ - :param module: AnsibleModule - :param rsp: ApiResponse from avi_api - :param changed: boolean - :param req: ApiRequest to avi_api - :param existing_obj: object to be passed debug output - :param api_context: api login context - - helper function to return the right ansible based on the error code and - changed - Returns: specific ansible module exit function - """ - - if rsp is not None and rsp.status_code > 299: - return module.fail_json( - msg='Error %d Msg %s req: %s api_context:%s ' % ( - rsp.status_code, rsp.text, req, api_context)) - api_creds = AviCredentials() - api_creds.update_from_ansible_module(module) - key = '%s:%s:%s' % (api_creds.controller, api_creds.username, - api_creds.port) - disable_fact = module.params.get('avi_disable_session_cache_as_fact') - - fact_context = None - if not disable_fact: - fact_context = module.params.get('api_context', {}) - if fact_context: - fact_context.update({key: api_context}) - else: - fact_context = {key: api_context} - - obj_val = rsp.json() if rsp else existing_obj - - if (obj_val and module.params.get("obj_username", None) and - "username" in obj_val): - obj_val["obj_username"] = obj_val["username"] - if (obj_val and module.params.get("obj_password", None) and - "password" in obj_val): - obj_val["obj_password"] = obj_val["password"] - old_obj_val = existing_obj if changed and existing_obj else None - api_context_val = api_context if disable_fact else None - ansible_facts_val = dict( - avi_api_context=fact_context) if not disable_fact else {} - - return module.exit_json( - changed=changed, obj=obj_val, old_obj=old_obj_val, - ansible_facts=ansible_facts_val, api_context=api_context_val) - - -def purge_optional_fields(obj, module): - """ - It purges the optional arguments to be sent to the controller. - :param obj: dictionary of the ansible object passed as argument. - :param module: AnsibleModule - return modified obj - """ - purge_fields = [] - for param, spec in module.argument_spec.items(): - if not spec.get('required', False): - if param not in obj: - # these are ansible common items - continue - if obj[param] is None: - purge_fields.append(param) - log.debug('purging fields %s', purge_fields) - for param in purge_fields: - obj.pop(param, None) - return obj - - -def cleanup_absent_fields(obj): - """ - cleans up any field that is marked as state: absent. It needs to be removed - from the object if it is present. - :param obj: - :return: Purged object - """ - if type(obj) != dict: - return obj - cleanup_keys = [] - for k, v in obj.items(): - if type(v) == dict: - if (('state' in v and v['state'] == 'absent') or - (v == "{'state': 'absent'}")): - cleanup_keys.append(k) - else: - cleanup_absent_fields(v) - if not v: - cleanup_keys.append(k) - elif type(v) == list: - new_list = [] - for elem in v: - elem = cleanup_absent_fields(elem) - if elem: - # remove the item from list - new_list.append(elem) - if new_list: - obj[k] = new_list - else: - cleanup_keys.append(k) - elif isinstance(v, str) or isinstance(v, str): - if v == "{'state': 'absent'}": - cleanup_keys.append(k) - for k in cleanup_keys: - del obj[k] - return obj - - -RE_REF_MATCH = re.compile(r'^/api/[\w/]+\?name\=[\w]+[^#<>]*$') -# if HTTP ref match then strip out the #name -HTTP_REF_MATCH = re.compile(r'https://[\w.0-9:-]+/api/.+') -HTTP_REF_W_NAME_MATCH = re.compile(r'https://[\w.0-9:-]+/api/.*#.+') - - -def ref_n_str_cmp(x, y): - """ - compares two references - 1. check for exact reference - 2. check for obj_type/uuid - 3. check for name - - if x is ref=name then extract uuid and name from y and use it. - if x is http_ref then - strip x and y - compare them. - - if x and y are urls then match with split on # - if x is a RE_REF_MATCH then extract name - if y is a REF_MATCH then extract name - :param x: first string - :param y: second string from controller's object - - Returns - True if they are equivalent else False - """ - if type(y) in (int, float, bool, int, complex): - y = str(y) - x = str(x) - if not (_check_type_string(x) and _check_type_string(y)): - return False - y_uuid = y_name = str(y) - x = str(x) - if RE_REF_MATCH.match(x): - x = x.split('name=')[1] - elif HTTP_REF_MATCH.match(x): - x = x.rsplit('#', 1)[0] - y = y.rsplit('#', 1)[0] - elif RE_REF_MATCH.match(y): - y = y.split('name=')[1] - - if HTTP_REF_W_NAME_MATCH.match(y): - path = y.split('api/', 1)[1] - # Fetching name or uuid from path /xxxx_xx/xx/xx_x/uuid_or_name - uuid_or_name = path.split('/')[-1] - parts = uuid_or_name.rsplit('#', 1) - y_uuid = parts[0] - y_name = parts[1] if len(parts) > 1 else '' - # is just string but y is a url so match either uuid or name - result = (x in (y, y_name, y_uuid)) - if not result: - log.debug('x: %s y: %s y_name %s y_uuid %s', - x, y, y_name, y_uuid) - return result - - -def avi_obj_cmp(x, y, sensitive_fields=None): - """ - compares whether x is fully contained in y. The comparision is different - from a simple dictionary compare for following reasons - 1. Some fields could be references. The object in controller returns the - full URL for those references. However, the ansible script would have - it specified as /api/pool?name=blah. So, the reference fields need - to match uuid, relative reference based on name and actual reference. - - 2. Optional fields with defaults: In case there are optional fields with - defaults then controller automatically fills it up. This would - cause the comparison with Ansible object specification to always return - changed. - - 3. Optional fields without defaults: This is most tricky. The issue is - how to specify deletion of such objects from ansible script. If the - ansible playbook has object specified as Null then Avi controller will - reject for non Message(dict) type fields. In addition, to deal with the - defaults=null issue all the fields that are set with None are purged - out before comparing with Avi controller's version - - So, the solution is to pass state: absent if any optional field needs - to be deleted from the configuration. The script would return changed - =true if it finds a key in the controller version and it is marked with - state: absent in ansible playbook. Alternatively, it would return - false if key is not present in the controller object. Before, doing - put or post it would purge the fields that are marked state: absent. - - :param x: first string - :param y: second string from controller's object - :param sensitive_fields: sensitive fields to ignore for diff - - Returns: - True if x is subset of y else False - """ - if not sensitive_fields: - sensitive_fields = set() - if isinstance(x, str) or isinstance(x, str): - # Special handling for strings as they can be references. - return ref_n_str_cmp(x, y) - if type(x) not in [list, dict]: - # if it is not list or dict or string then simply compare the values - return x == y - if type(x) == list: - # should compare each item in the list and that should match - if len(x) != len(y): - log.debug('x has %d items y has %d', len(x), len(y)) - return False - for i in zip(x, y): - if not avi_obj_cmp(i[0], i[1], sensitive_fields=sensitive_fields): - # no need to continue - return False - - if type(x) == dict: - x.pop('_last_modified', None) - x.pop('tenant', None) - y.pop('_last_modified', None) - x.pop('api_version', None) - y.pop('api_verison', None) - d_xks = [k for k in x.keys() if k in sensitive_fields] - - if d_xks: - # if there is sensitive field then always return changed - return False - # pop the keys that are marked deleted but not present in y - # return false if item is marked absent and is present in y - d_x_absent_ks = [] - for k, v in x.items(): - if v is None: - d_x_absent_ks.append(k) - continue - if isinstance(v, dict): - if ('state' in v) and (v['state'] == 'absent'): - if type(y) == dict and k not in y: - d_x_absent_ks.append(k) - else: - return False - elif not v: - d_x_absent_ks.append(k) - elif isinstance(v, list) and not v: - d_x_absent_ks.append(k) - # Added condition to check key in dict. - elif isinstance(v, str) or (k in y and isinstance(y[k], str)): - # this is the case when ansible converts the dictionary into a - # string. - if v == "{'state': 'absent'}" and k not in y: - d_x_absent_ks.append(k) - elif not v and k not in y: - # this is the case when x has set the value that qualifies - # as not but y does not have that value - d_x_absent_ks.append(k) - for k in d_x_absent_ks: - x.pop(k) - x_keys = set(x.keys()) - y_keys = set(y.keys()) - if not x_keys.issubset(y_keys): - # log.debug('x has %s and y has %s keys', len(x_keys), len(y_keys)) - return False - for k, v in x.items(): - if k not in y: - # log.debug('k %s is not in y %s', k, y) - return False - if not avi_obj_cmp(v, y[k], sensitive_fields=sensitive_fields): - # log.debug('k %s v %s did not match in y %s', k, v, y[k]) - return False - return True - - -POP_FIELDS = ['state', 'controller', 'username', 'password', 'api_version', - 'avi_credentials', 'avi_api_update_method', 'avi_api_patch_op', - 'api_context', 'tenant', 'tenant_uuid', 'avi_disable_session_cache_as_fact'] - - -def get_api_context(module, api_creds): - api_context = module.params.get('api_context') - if api_context and module.params.get('avi_disable_session_cache_as_fact'): - return api_context - elif api_context and not module.params.get( - 'avi_disable_session_cache_as_fact'): - key = '%s:%s:%s' % (api_creds.controller, api_creds.username, - api_creds.port) - return api_context.get(key) - else: - return None - - -def avi_ansible_api(module, obj_type, sensitive_fields): - """ - This converts the Ansible module into AVI object and invokes APIs - :param module: Ansible module - :param obj_type: string representing Avi object type - :param sensitive_fields: sensitive fields to be excluded for comparison - purposes. - Returns: - success: module.exit_json with obj=avi object - faliure: module.fail_json - """ - - api_creds = AviCredentials() - api_creds.update_from_ansible_module(module) - api_context = get_api_context(module, api_creds) - if api_context: - api = ApiSession.get_session( - api_creds.controller, - api_creds.username, - password=api_creds.password, - timeout=api_creds.timeout, - tenant=api_creds.tenant, - tenant_uuid=api_creds.tenant_uuid, - token=api_context['csrftoken'], - port=api_creds.port, - session_id=api_context['session_id'], - csrftoken=api_context['csrftoken']) - else: - api = ApiSession.get_session( - api_creds.controller, - api_creds.username, - password=api_creds.password, - timeout=api_creds.timeout, - tenant=api_creds.tenant, - tenant_uuid=api_creds.tenant_uuid, - token=api_creds.token, - port=api_creds.port) - state = module.params['state'] - # Get the api version. - avi_update_method = module.params.get('avi_api_update_method', 'put') - avi_patch_op = module.params.get('avi_api_patch_op', 'add') - - api_version = api_creds.api_version - name = module.params.get('name', None) - # Added Support to get uuid - uuid = module.params.get('uuid', None) - check_mode = module.check_mode - if uuid and obj_type != 'cluster': - obj_path = '%s/%s' % (obj_type, uuid) - else: - obj_path = '%s/' % obj_type - obj = deepcopy(module.params) - tenant = obj.pop('tenant', '') - tenant_uuid = obj.pop('tenant_uuid', '') - # obj.pop('cloud_ref', None) - for k in POP_FIELDS: - obj.pop(k, None) - purge_optional_fields(obj, module) - - # Special code to handle situation where object has a field - # named username. This is used in case of api/user - # The following code copies the username and password - # from the obj_username and obj_password fields. - if 'obj_username' in obj: - obj['username'] = obj['obj_username'] - obj.pop('obj_username') - if 'obj_password' in obj: - obj['password'] = obj['obj_password'] - obj.pop('obj_password') - if 'full_name' not in obj and 'name' in obj and obj_type == "user": - obj['full_name'] = obj['name'] - # Special case as name represent full_name in user module - # As per API response, name is always same as username regardless of full_name - obj['name'] = obj['username'] - - log.info('passed object %s ', obj) - - if uuid: - # Get the object based on uuid. - try: - existing_obj = api.get( - obj_path, tenant=tenant, tenant_uuid=tenant_uuid, - params={'include_refs': '', 'include_name': ''}, - api_version=api_version) - existing_obj = existing_obj.json() - except ObjectNotFound: - existing_obj = None - elif name: - params = {'include_refs': '', 'include_name': ''} - if obj.get('cloud_ref', None): - # this is the case when gets have to be scoped with cloud - cloud = obj['cloud_ref'].split('name=')[1] - params['cloud_ref.name'] = cloud - existing_obj = api.get_object_by_name( - obj_type, name, tenant=tenant, tenant_uuid=tenant_uuid, - params=params, api_version=api_version) - - # Need to check if tenant_ref was provided and the object returned - # is actually in admin tenant. - if existing_obj and 'tenant_ref' in obj and 'tenant_ref' in existing_obj: - # https://10.10.25.42/api/tenant/admin#admin - existing_obj_tenant = existing_obj['tenant_ref'].split('#')[1] - obj_tenant = obj['tenant_ref'].split('name=')[1] - if obj_tenant != existing_obj_tenant: - existing_obj = None - else: - # added api version to avi api call. - existing_obj = api.get(obj_path, tenant=tenant, tenant_uuid=tenant_uuid, - params={'include_refs': '', 'include_name': ''}, - api_version=api_version).json() - - if state == 'absent': - rsp = None - changed = False - err = False - if not check_mode and existing_obj: - try: - if name is not None: - # added api version to avi api call. - rsp = api.delete_by_name( - obj_type, name, tenant=tenant, tenant_uuid=tenant_uuid, - api_version=api_version) - else: - # added api version to avi api call. - rsp = api.delete( - obj_path, tenant=tenant, tenant_uuid=tenant_uuid, - api_version=api_version) - except ObjectNotFound: - pass - if check_mode and existing_obj: - changed = True - - if rsp: - if rsp.status_code == 204: - changed = True - else: - err = True - if not err: - return ansible_return( - module, rsp, changed, existing_obj=existing_obj, - api_context=api.get_context()) - elif rsp: - return module.fail_json(msg=rsp.text) - - rsp = None - req = None - if existing_obj: - # this is case of modify as object exists. should find out - # if changed is true or not - if name is not None and obj_type != 'cluster': - obj_uuid = existing_obj['uuid'] - obj_path = '%s/%s' % (obj_type, obj_uuid) - if avi_update_method == 'put': - changed = not avi_obj_cmp(obj, existing_obj, sensitive_fields) - obj = cleanup_absent_fields(obj) - if changed: - req = obj - if check_mode: - # No need to process any further. - rsp = AviCheckModeResponse(obj=existing_obj) - else: - rsp = api.put( - obj_path, data=req, tenant=tenant, - tenant_uuid=tenant_uuid, api_version=api_version) - elif check_mode: - rsp = AviCheckModeResponse(obj=existing_obj) - else: - if check_mode: - # No need to process any further. - rsp = AviCheckModeResponse(obj=existing_obj) - changed = True - else: - obj.pop('name', None) - patch_data = {avi_patch_op: obj} - rsp = api.patch( - obj_path, data=patch_data, tenant=tenant, - tenant_uuid=tenant_uuid, api_version=api_version) - obj = rsp.json() - changed = not avi_obj_cmp(obj, existing_obj) - if changed: - log.debug('EXISTING OBJ %s', existing_obj) - log.debug('NEW OBJ %s', obj) - else: - changed = True - req = obj - if check_mode: - rsp = AviCheckModeResponse(obj=None) - else: - rsp = api.post(obj_type, data=obj, tenant=tenant, - tenant_uuid=tenant_uuid, api_version=api_version) - return ansible_return(module, rsp, changed, req, existing_obj=existing_obj, - api_context=api.get_context()) - - -def avi_common_argument_spec(): - """ - Returns common arguments for all Avi modules - :return: dict - """ - credentials_spec = dict( - controller=dict(fallback=(env_fallback, ['AVI_CONTROLLER'])), - username=dict(fallback=(env_fallback, ['AVI_USERNAME'])), - password=dict(fallback=(env_fallback, ['AVI_PASSWORD']), no_log=True), - api_version=dict(default='16.4.4', type='str'), - tenant=dict(default='admin'), - tenant_uuid=dict(default='', type='str'), - port=dict(type='int'), - timeout=dict(default=300, type='int'), - token=dict(default='', type='str', no_log=True), - session_id=dict(default='', type='str', no_log=True), - csrftoken=dict(default='', type='str', no_log=True) - ) - - return dict( - controller=dict(fallback=(env_fallback, ['AVI_CONTROLLER'])), - username=dict(fallback=(env_fallback, ['AVI_USERNAME'])), - password=dict(fallback=(env_fallback, ['AVI_PASSWORD']), no_log=True), - tenant=dict(default='admin'), - tenant_uuid=dict(default=''), - api_version=dict(default='16.4.4', type='str'), - avi_credentials=dict(default=None, type='dict', - options=credentials_spec), - api_context=dict(type='dict'), - avi_disable_session_cache_as_fact=dict(default=False, type='bool')) diff --git a/plugins/module_utils/network/avi/avi.py b/plugins/module_utils/network/avi/avi.py deleted file mode 100644 index 649a16bf..00000000 --- a/plugins/module_utils/network/avi/avi.py +++ /dev/null @@ -1,39 +0,0 @@ -# This code is part of Ansible, but is an independent component. -# This particular file snippet, and this file snippet only, is BSD licensed. -# Modules you write using this snippet, which is embedded dynamically by Ansible -# still belong to the author of the module, and may assign their own license -# to the complete work. -# -# Copyright (c), Gaurav Rastogi , 2017 -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# This module initially matched the namespace of network module avi. However, -# that causes namespace import error when other modules from avi namespaces -# are imported. Added import of absolute_import to avoid import collisions for -# avi.sdk. - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -from ansible_collections.community.network.plugins.module_utils.network.avi.ansible_utils import ( - avi_ansible_api, avi_common_argument_spec, ansible_return, - avi_obj_cmp, cleanup_absent_fields, AviCheckModeResponse, HAS_AVI) diff --git a/plugins/module_utils/network/avi/avi_api.py b/plugins/module_utils/network/avi/avi_api.py deleted file mode 100644 index 684b2dd1..00000000 --- a/plugins/module_utils/network/avi/avi_api.py +++ /dev/null @@ -1,974 +0,0 @@ -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -import os -import sys -import copy -import json -import logging -import time -from datetime import datetime, timedelta -from ssl import SSLError - - -class MockResponse(object): - def __init__(self, *args, **kwargs): - raise Exception("Requests library Response object not found. Using fake one.") - - -class MockRequestsConnectionError(Exception): - pass - - -class MockSession(object): - def __init__(self, *args, **kwargs): - raise Exception("Requests library Session object not found. Using fake one.") - - -HAS_AVI = True -try: - from requests import ConnectionError as RequestsConnectionError - from requests import Response - from requests.sessions import Session -except ImportError: - HAS_AVI = False - Response = MockResponse - RequestsConnectionError = MockRequestsConnectionError - Session = MockSession - - -logger = logging.getLogger(__name__) - -sessionDict = {} - - -def avi_timedelta(td): - ''' - This is a wrapper class to workaround python 2.6 builtin datetime.timedelta - does not have total_seconds method - :param timedelta object - ''' - if type(td) != timedelta: - raise TypeError() - if sys.version_info >= (2, 7): - ts = td.total_seconds() - else: - ts = td.seconds + (24 * 3600 * td.days) - return ts - - -def avi_sdk_syslog_logger(logger_name='avi.sdk'): - # The following sets up syslog module to log underlying avi SDK messages - # based on the environment variables: - # AVI_LOG_HANDLER: names the logging handler to use. Only syslog is - # supported. - # AVI_LOG_LEVEL: Logging level used for the avi SDK. Default is DEBUG - # AVI_SYSLOG_ADDRESS: Destination address for the syslog handler. - # Default is /dev/log - from logging.handlers import SysLogHandler - lf = '[%(asctime)s] %(levelname)s [%(module)s.%(funcName)s:%(lineno)d] %(message)s' - log = logging.getLogger(logger_name) - log_level = os.environ.get('AVI_LOG_LEVEL', 'DEBUG') - if log_level: - log.setLevel(getattr(logging, log_level)) - formatter = logging.Formatter(lf) - sh = SysLogHandler(address=os.environ.get('AVI_SYSLOG_ADDRESS', '/dev/log')) - sh.setFormatter(formatter) - log.addHandler(sh) - return log - - -class ObjectNotFound(Exception): - pass - - -class APIError(Exception): - def __init__(self, arg, rsp=None): - self.args = [arg, rsp] - self.rsp = rsp - - -class AviServerError(APIError): - def __init__(self, arg, rsp=None): - super(AviServerError, self).__init__(arg, rsp) - - -class APINotImplemented(Exception): - pass - - -class ApiResponse(Response): - """ - Returns copy of the requests.Response object provides additional helper - routines - 1. obj: returns dictionary of Avi Object - """ - def __init__(self, rsp): - super(ApiResponse, self).__init__() - for k, v in list(rsp.__dict__.items()): - setattr(self, k, v) - - def json(self): - """ - Extends the session default json interface to handle special errors - and raise Exceptions - returns the Avi object as a dictionary from rsp.text - """ - if self.status_code in (200, 201): - if not self.text: - # In cases like status_code == 201 the response text could be - # empty string. - return None - return super(ApiResponse, self).json() - elif self.status_code == 204: - # No response needed; e.g., delete operation - return None - elif self.status_code == 404: - raise ObjectNotFound('HTTP Error: %s Error Msg %s' % ( - self.status_code, self.text), self) - elif self.status_code >= 500: - raise AviServerError('HTTP Error: %s Error Msg %s' % ( - self.status_code, self.text), self) - else: - raise APIError('HTTP Error: %s Error Msg %s' % ( - self.status_code, self.text), self) - - def count(self): - """ - return the number of objects in the collection response. If it is not - a collection response then it would simply return 1. - """ - obj = self.json() - if 'count' in obj: - # this was a resposne to collection - return obj['count'] - return 1 - - @staticmethod - def to_avi_response(resp): - if type(resp) == Response: - return ApiResponse(resp) - return resp - - -class AviCredentials(object): - controller = '' - username = '' - password = '' - api_version = '16.4.4' - tenant = None - tenant_uuid = None - token = None - port = None - timeout = 300 - session_id = None - csrftoken = None - - def __init__(self, **kwargs): - for k, v in kwargs.items(): - setattr(self, k, v) - - def update_from_ansible_module(self, m): - """ - :param m: ansible module - :return: - """ - if m.params.get('avi_credentials'): - for k, v in m.params['avi_credentials'].items(): - if hasattr(self, k): - setattr(self, k, v) - if m.params['controller']: - self.controller = m.params['controller'] - if m.params['username']: - self.username = m.params['username'] - if m.params['password']: - self.password = m.params['password'] - if (m.params['api_version'] and - (m.params['api_version'] != '16.4.4')): - self.api_version = m.params['api_version'] - if m.params['tenant']: - self.tenant = m.params['tenant'] - if m.params['tenant_uuid']: - self.tenant_uuid = m.params['tenant_uuid'] - if m.params.get('session_id'): - self.session_id = m.params['session_id'] - if m.params.get('csrftoken'): - self.csrftoken = m.params['csrftoken'] - - def __str__(self): - return 'controller %s user %s api %s tenant %s' % ( - self.controller, self.username, self.api_version, self.tenant) - - -class ApiSession(Session): - """ - Extends the Request library's session object to provide helper - utilities to work with Avi Controller like authentication, api massaging - etc. - """ - - # This keeps track of the process which created the cache. - # At anytime the pid of the process changes then it would create - # a new cache for that process. - AVI_SLUG = 'Slug' - SESSION_CACHE_EXPIRY = 20 * 60 - SHARED_USER_HDRS = ['X-CSRFToken', 'Session-Id', 'Referer', 'Content-Type'] - MAX_API_RETRIES = 3 - - def __init__(self, controller_ip=None, username=None, password=None, - token=None, tenant=None, tenant_uuid=None, verify=False, - port=None, timeout=60, api_version=None, - retry_conxn_errors=True, data_log=False, - avi_credentials=None, session_id=None, csrftoken=None, - lazy_authentication=False, max_api_retries=None): - """ - ApiSession takes ownership of avi_credentials and may update the - information inside it. - - Initialize new session object with authenticated token from login api. - It also keeps a cache of user sessions that are cleaned up if inactive - for more than 20 mins. - - Notes: - 01. If mode is https and port is none or 443, we don't embed the - port in the prefix. The prefix would be 'https://ip'. If port - is a non-default value then we concatenate https://ip:port - in the prefix. - 02. If mode is http and the port is none or 80, we don't embed the - port in the prefix. The prefix would be 'http://ip'. If port is - a non-default value, then we concatenate http://ip:port in - the prefix. - """ - super(ApiSession, self).__init__() - if not avi_credentials: - tenant = tenant if tenant else "admin" - self.avi_credentials = AviCredentials( - controller=controller_ip, username=username, password=password, - api_version=api_version, tenant=tenant, tenant_uuid=tenant_uuid, - token=token, port=port, timeout=timeout, - session_id=session_id, csrftoken=csrftoken) - else: - self.avi_credentials = avi_credentials - self.headers = {} - self.verify = verify - self.retry_conxn_errors = retry_conxn_errors - self.remote_api_version = {} - self.session_cookie_name = '' - self.user_hdrs = {} - self.data_log = data_log - self.num_session_retries = 0 - self.retry_wait_time = 0 - self.max_session_retries = ( - self.MAX_API_RETRIES if max_api_retries is None - else int(max_api_retries)) - # Refer Notes 01 and 02 - k_port = port if port else 443 - if self.avi_credentials.controller.startswith('http'): - k_port = 80 if not self.avi_credentials.port else k_port - if self.avi_credentials.port is None or self.avi_credentials.port\ - == 80: - self.prefix = self.avi_credentials.controller - else: - self.prefix = '{x}:{y}'.format( - x=self.avi_credentials.controller, - y=self.avi_credentials.port) - else: - if port is None or port == 443: - self.prefix = 'https://{x}'.format( - x=self.avi_credentials.controller) - else: - self.prefix = 'https://{x}:{y}'.format( - x=self.avi_credentials.controller, - y=self.avi_credentials.port) - self.timeout = timeout - self.key = '%s:%s:%s' % (self.avi_credentials.controller, - self.avi_credentials.username, k_port) - # Added api token and session id to sessionDict for handle single - # session - if self.avi_credentials.csrftoken: - sessionDict[self.key] = { - 'api': self, - "csrftoken": self.avi_credentials.csrftoken, - "session_id": self.avi_credentials.session_id, - "last_used": datetime.utcnow() - } - elif lazy_authentication: - sessionDict.get(self.key, {}).update( - {'api': self, "last_used": datetime.utcnow()}) - else: - self.authenticate_session() - - self.num_session_retries = 0 - self.pid = os.getpid() - ApiSession._clean_inactive_sessions() - return - - @property - def controller_ip(self): - return self.avi_credentials.controller - - @controller_ip.setter - def controller_ip(self, controller_ip): - self.avi_credentials.controller = controller_ip - - @property - def username(self): - return self.avi_credentials.username - - @property - def connected(self): - return sessionDict.get(self.key, {}).get('connected', False) - - @username.setter - def username(self, username): - self.avi_credentials.username = username - - @property - def password(self): - return self.avi_credentials.password - - @password.setter - def password(self, password): - self.avi_credentials.password = password - - @property - def keystone_token(self): - return sessionDict.get(self.key, {}).get('csrftoken', None) - - @keystone_token.setter - def keystone_token(self, token): - sessionDict[self.key]['csrftoken'] = token - - @property - def tenant_uuid(self): - self.avi_credentials.tenant_uuid - - @tenant_uuid.setter - def tenant_uuid(self, tenant_uuid): - self.avi_credentials.tenant_uuid = tenant_uuid - - @property - def tenant(self): - return self.avi_credentials.tenant - - @tenant.setter - def tenant(self, tenant): - if tenant: - self.avi_credentials.tenant = tenant - else: - self.avi_credentials.tenant = 'admin' - - @property - def port(self): - self.avi_credentials.port - - @port.setter - def port(self, port): - self.avi_credentials.port = port - - @property - def api_version(self): - return self.avi_credentials.api_version - - @api_version.setter - def api_version(self, api_version): - self.avi_credentials.api_version = api_version - - @property - def session_id(self): - return sessionDict[self.key]['session_id'] - - def get_context(self): - return { - 'session_id': sessionDict[self.key]['session_id'], - 'csrftoken': sessionDict[self.key]['csrftoken'] - } - - @staticmethod - def clear_cached_sessions(): - global sessionDict - sessionDict = {} - - @staticmethod - def get_session( - controller_ip=None, username=None, password=None, token=None, tenant=None, - tenant_uuid=None, verify=False, port=None, timeout=60, - retry_conxn_errors=True, api_version=None, data_log=False, - avi_credentials=None, session_id=None, csrftoken=None, - lazy_authentication=False, max_api_retries=None): - """ - returns the session object for same user and tenant - calls init if session dose not exist and adds it to session cache - :param controller_ip: controller IP address - :param username: - :param password: - :param token: Token to use; example, a valid keystone token - :param tenant: Name of the tenant on Avi Controller - :param tenant_uuid: Don't specify tenant when using tenant_id - :param port: Rest-API may use a different port other than 443 - :param timeout: timeout for API calls; Default value is 60 seconds - :param retry_conxn_errors: retry on connection errors - :param api_version: Controller API version - """ - if not avi_credentials: - tenant = tenant if tenant else "admin" - avi_credentials = AviCredentials( - controller=controller_ip, username=username, password=password, - api_version=api_version, tenant=tenant, tenant_uuid=tenant_uuid, - token=token, port=port, timeout=timeout, - session_id=session_id, csrftoken=csrftoken) - - k_port = avi_credentials.port if avi_credentials.port else 443 - if avi_credentials.controller.startswith('http'): - k_port = 80 if not avi_credentials.port else k_port - key = '%s:%s:%s' % (avi_credentials.controller, - avi_credentials.username, k_port) - cached_session = sessionDict.get(key) - if cached_session: - user_session = cached_session['api'] - if not (user_session.avi_credentials.csrftoken or - lazy_authentication): - user_session.authenticate_session() - else: - user_session = ApiSession( - controller_ip, username, password, token=token, tenant=tenant, - tenant_uuid=tenant_uuid, verify=verify, port=port, - timeout=timeout, retry_conxn_errors=retry_conxn_errors, - api_version=api_version, data_log=data_log, - avi_credentials=avi_credentials, - lazy_authentication=lazy_authentication, - max_api_retries=max_api_retries) - ApiSession._clean_inactive_sessions() - return user_session - - def reset_session(self): - """ - resets and re-authenticates the current session. - """ - sessionDict[self.key]['connected'] = False - logger.info('resetting session for %s', self.key) - self.user_hdrs = {} - for k, v in self.headers.items(): - if k not in self.SHARED_USER_HDRS: - self.user_hdrs[k] = v - self.headers = {} - self.authenticate_session() - - def authenticate_session(self): - """ - Performs session authentication with Avi controller and stores - session cookies and sets header options like tenant. - """ - body = {"username": self.avi_credentials.username} - if self.avi_credentials.password: - body["password"] = self.avi_credentials.password - elif self.avi_credentials.token: - body["token"] = self.avi_credentials.token - else: - raise APIError("Neither user password or token provided") - logger.debug('authenticating user %s prefix %s', - self.avi_credentials.username, self.prefix) - self.cookies.clear() - err = None - try: - rsp = super(ApiSession, self).post( - self.prefix + "/login", body, timeout=self.timeout, verify=self.verify) - - if rsp.status_code == 200: - self.num_session_retries = 0 - self.remote_api_version = rsp.json().get('version', {}) - self.session_cookie_name = rsp.json().get('session_cookie_name', 'sessionid') - self.headers.update(self.user_hdrs) - if rsp.cookies and 'csrftoken' in rsp.cookies: - csrftoken = rsp.cookies['csrftoken'] - sessionDict[self.key] = { - 'csrftoken': csrftoken, - 'session_id': rsp.cookies[self.session_cookie_name], - 'last_used': datetime.utcnow(), - 'api': self, - 'connected': True - } - logger.debug("authentication success for user %s", - self.avi_credentials.username) - return - # Check for bad request and invalid credentials response code - elif rsp.status_code in [401, 403]: - logger.error('Status Code %s msg %s', rsp.status_code, rsp.text) - err = APIError('Status Code %s msg %s' % ( - rsp.status_code, rsp.text), rsp) - raise err - else: - logger.error("Error status code %s msg %s", rsp.status_code, - rsp.text) - err = APIError('Status Code %s msg %s' % ( - rsp.status_code, rsp.text), rsp) - except (RequestsConnectionError, SSLError) as e: - if not self.retry_conxn_errors: - raise - logger.warning('Connection error retrying %s', e) - err = e - # comes here only if there was either exception or login was not - # successful - if self.retry_wait_time: - time.sleep(self.retry_wait_time) - self.num_session_retries += 1 - if self.num_session_retries > self.max_session_retries: - self.num_session_retries = 0 - logger.error("giving up after %d retries connection failure %s", - self.max_session_retries, True) - ret_err = ( - err if err else APIError("giving up after %d retries connection failure %s" % - (self.max_session_retries, True))) - raise ret_err - self.authenticate_session() - return - - def _get_api_headers(self, tenant, tenant_uuid, timeout, headers, - api_version): - """ - returns the headers that are passed to the requests.Session api calls. - """ - api_hdrs = copy.deepcopy(self.headers) - api_hdrs.update({ - "Referer": self.prefix, - "Content-Type": "application/json" - }) - api_hdrs['timeout'] = str(timeout) - if self.key in sessionDict and 'csrftoken' in sessionDict.get(self.key): - api_hdrs['X-CSRFToken'] = sessionDict.get(self.key)['csrftoken'] - else: - self.authenticate_session() - api_hdrs['X-CSRFToken'] = sessionDict.get(self.key)['csrftoken'] - if api_version: - api_hdrs['X-Avi-Version'] = api_version - elif self.avi_credentials.api_version: - api_hdrs['X-Avi-Version'] = self.avi_credentials.api_version - if tenant: - tenant_uuid = None - elif tenant_uuid: - tenant = None - else: - tenant = self.avi_credentials.tenant - tenant_uuid = self.avi_credentials.tenant_uuid - if tenant_uuid: - api_hdrs.update({"X-Avi-Tenant-UUID": "%s" % tenant_uuid}) - api_hdrs.pop("X-Avi-Tenant", None) - elif tenant: - api_hdrs.update({"X-Avi-Tenant": "%s" % tenant}) - api_hdrs.pop("X-Avi-Tenant-UUID", None) - # Override any user headers that were passed by users. We don't know - # when the user had updated the user_hdrs - if self.user_hdrs: - api_hdrs.update(self.user_hdrs) - if headers: - # overwrite the headers passed via the API calls. - api_hdrs.update(headers) - return api_hdrs - - def _api(self, api_name, path, tenant, tenant_uuid, data=None, - headers=None, timeout=None, api_version=None, **kwargs): - """ - It calls the requests.Session APIs and handles session expiry - and other situations where session needs to be reset. - returns ApiResponse object - :param path: takes relative path to the AVI api. - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param headers: dictionary of headers that override the session - headers. - """ - if self.pid != os.getpid(): - logger.info('pid %d change detected new %d. Closing session', - self.pid, os.getpid()) - self.close() - self.pid = os.getpid() - if timeout is None: - timeout = self.timeout - fullpath = self._get_api_path(path) - fn = getattr(super(ApiSession, self), api_name) - api_hdrs = self._get_api_headers(tenant, tenant_uuid, timeout, headers, - api_version) - connection_error = False - err = None - cookies = { - 'csrftoken': api_hdrs['X-CSRFToken'], - } - try: - if self.session_cookie_name: - cookies[self.session_cookie_name] = sessionDict[self.key]['session_id'] - except KeyError: - pass - try: - if (data is not None) and (type(data) == dict): - resp = fn(fullpath, data=json.dumps(data), headers=api_hdrs, - timeout=timeout, cookies=cookies, **kwargs) - else: - resp = fn(fullpath, data=data, headers=api_hdrs, - timeout=timeout, cookies=cookies, **kwargs) - except (RequestsConnectionError, SSLError) as e: - logger.warning('Connection error retrying %s', e) - if not self.retry_conxn_errors: - raise - connection_error = True - err = e - except Exception as e: - logger.error('Error in Requests library %s', e) - raise - if not connection_error: - logger.debug('path: %s http_method: %s hdrs: %s params: ' - '%s data: %s rsp: %s', fullpath, api_name.upper(), - api_hdrs, kwargs, data, - (resp.text if self.data_log else 'None')) - if connection_error or resp.status_code in (401, 419): - if connection_error: - try: - self.close() - except Exception: - # ignoring exception in cleanup path - pass - logger.warning('Connection failed, retrying.') - # Adding sleep before retrying - if self.retry_wait_time: - time.sleep(self.retry_wait_time) - else: - logger.info('received error %d %s so resetting connection', - resp.status_code, resp.text) - ApiSession.reset_session(self) - self.num_session_retries += 1 - if self.num_session_retries > self.max_session_retries: - # Added this such that any code which re-tries can succeed - # eventually. - self.num_session_retries = 0 - if not connection_error: - err = APIError('Status Code %s msg %s' % ( - resp.status_code, resp.text), resp) - logger.error( - "giving up after %d retries conn failure %s err %s", - self.max_session_retries, connection_error, err) - ret_err = ( - err if err else APIError("giving up after %d retries connection failure %s" % - (self.max_session_retries, True))) - raise ret_err - # should restore the updated_hdrs to one passed down - resp = self._api(api_name, path, tenant, tenant_uuid, data, - headers=headers, api_version=api_version, - timeout=timeout, **kwargs) - self.num_session_retries = 0 - - if resp.cookies and 'csrftoken' in resp.cookies: - csrftoken = resp.cookies['csrftoken'] - self.headers.update({"X-CSRFToken": csrftoken}) - self._update_session_last_used() - return ApiResponse.to_avi_response(resp) - - def get_controller_details(self): - result = { - "controller_ip": self.controller_ip, - "controller_api_version": self.remote_api_version - } - return result - - def get(self, path, tenant='', tenant_uuid='', timeout=None, params=None, - api_version=None, **kwargs): - """ - It extends the Session Library interface to add AVI API prefixes, - handle session exceptions related to authentication and update - the global user session cache. - :param path: takes relative path to the AVI api. - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param api_version: overrides x-avi-header in request header during - session creation - get method takes relative path to service and kwargs as per Session - class get method - returns session's response object - """ - return self._api('get', path, tenant, tenant_uuid, timeout=timeout, - params=params, api_version=api_version, **kwargs) - - def get_object_by_name(self, path, name, tenant='', tenant_uuid='', - timeout=None, params=None, api_version=None, - **kwargs): - """ - Helper function to access Avi REST Objects using object - type and name. It behaves like python dictionary interface where it - returns None when the object is not present in the AviController. - Internally, it transforms the request to api/path?name=... - :param path: relative path to service - :param name: name of the object - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param api_version: overrides x-avi-header in request header during - session creation - returns dictionary object if successful else None - """ - obj = None - if not params: - params = {} - params['name'] = name - resp = self.get(path, tenant=tenant, tenant_uuid=tenant_uuid, - timeout=timeout, - params=params, api_version=api_version, **kwargs) - if resp.status_code in (401, 419): - ApiSession.reset_session(self) - resp = self.get_object_by_name( - path, name, tenant, tenant_uuid, timeout=timeout, - params=params, **kwargs) - if resp.status_code > 499 or 'Invalid version' in resp.text: - logger.error('Error in get object by name for %s named %s. ' - 'Error: %s', path, name, resp.text) - raise AviServerError(resp.text, rsp=resp) - elif resp.status_code > 299: - return obj - try: - if 'results' in resp.json(): - obj = resp.json()['results'][0] - else: - # For apis returning single object eg. api/cluster - obj = resp.json() - except IndexError: - logger.warning('Warning: Object Not found for %s named %s', - path, name) - obj = None - self._update_session_last_used() - return obj - - def post(self, path, data=None, tenant='', tenant_uuid='', timeout=None, - force_uuid=None, params=None, api_version=None, **kwargs): - """ - It extends the Session Library interface to add AVI API prefixes, - handle session exceptions related to authentication and update - the global user session cache. - :param path: takes relative path to the AVI api.It is modified by - the library to conform to AVI Controller's REST API interface - :param data: dictionary of the data. Support for json string - is deprecated - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param api_version: overrides x-avi-header in request header during - session creation - returns session's response object - """ - if force_uuid is not None: - headers = kwargs.get('headers', {}) - headers[self.AVI_SLUG] = force_uuid - kwargs['headers'] = headers - return self._api('post', path, tenant, tenant_uuid, data=data, - timeout=timeout, params=params, - api_version=api_version, **kwargs) - - def put(self, path, data=None, tenant='', tenant_uuid='', - timeout=None, params=None, api_version=None, **kwargs): - """ - It extends the Session Library interface to add AVI API prefixes, - handle session exceptions related to authentication and update - the global user session cache. - :param path: takes relative path to the AVI api.It is modified by - the library to conform to AVI Controller's REST API interface - :param data: dictionary of the data. Support for json string - is deprecated - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param api_version: overrides x-avi-header in request header during - session creation - returns session's response object - """ - return self._api('put', path, tenant, tenant_uuid, data=data, - timeout=timeout, params=params, - api_version=api_version, **kwargs) - - def patch(self, path, data=None, tenant='', tenant_uuid='', - timeout=None, params=None, api_version=None, **kwargs): - """ - It extends the Session Library interface to add AVI API prefixes, - handle session exceptions related to authentication and update - the global user session cache. - :param path: takes relative path to the AVI api.It is modified by - the library to conform to AVI Controller's REST API interface - :param data: dictionary of the data. Support for json string - is deprecated - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param api_version: overrides x-avi-header in request header during - session creation - returns session's response object - """ - return self._api('patch', path, tenant, tenant_uuid, data=data, - timeout=timeout, params=params, - api_version=api_version, **kwargs) - - def put_by_name(self, path, name, data=None, tenant='', - tenant_uuid='', timeout=None, params=None, - api_version=None, **kwargs): - """ - Helper function to perform HTTP PUT on Avi REST Objects using object - type and name. - Internally, it transforms the request to api/path?name=... - :param path: relative path to service - :param name: name of the object - :param data: dictionary of the data. Support for json string - is deprecated - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param api_version: overrides x-avi-header in request header during - session creation - returns session's response object - """ - uuid = self._get_uuid_by_name( - path, name, tenant, tenant_uuid, api_version=api_version) - path = '%s/%s' % (path, uuid) - return self.put(path, data, tenant, tenant_uuid, timeout=timeout, - params=params, api_version=api_version, **kwargs) - - def delete(self, path, tenant='', tenant_uuid='', timeout=None, params=None, - data=None, api_version=None, **kwargs): - """ - It extends the Session Library interface to add AVI API prefixes, - handle session exceptions related to authentication and update - the global user session cache. - :param path: takes relative path to the AVI api.It is modified by - the library to conform to AVI Controller's REST API interface - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param data: dictionary of the data. Support for json string - is deprecated - :param api_version: overrides x-avi-header in request header during - session creation - returns session's response object - """ - return self._api('delete', path, tenant, tenant_uuid, data=data, - timeout=timeout, params=params, - api_version=api_version, **kwargs) - - def delete_by_name(self, path, name, tenant='', tenant_uuid='', - timeout=None, params=None, api_version=None, **kwargs): - """ - Helper function to perform HTTP DELETE on Avi REST Objects using object - type and name.Internally, it transforms the request to - api/path?name=... - :param path: relative path to service - :param name: name of the object - :param tenant: overrides the tenant used during session creation - :param tenant_uuid: overrides the tenant or tenant_uuid during session - creation - :param timeout: timeout for API calls; Default value is 60 seconds - :param params: dictionary of key value pairs to be sent as query - parameters - :param api_version: overrides x-avi-header in request header during - session creation - returns session's response object - """ - uuid = self._get_uuid_by_name(path, name, tenant, tenant_uuid, - api_version=api_version) - if not uuid: - raise ObjectNotFound("%s/?name=%s" % (path, name)) - path = '%s/%s' % (path, uuid) - return self.delete(path, tenant, tenant_uuid, timeout=timeout, - params=params, api_version=api_version, **kwargs) - - def get_obj_ref(self, obj): - """returns reference url from dict object""" - if not obj: - return None - if isinstance(obj, Response): - obj = json.loads(obj.text) - if obj.get(0, None): - return obj[0]['url'] - elif obj.get('url', None): - return obj['url'] - elif obj.get('results', None): - return obj['results'][0]['url'] - else: - return None - - def get_obj_uuid(self, obj): - """returns uuid from dict object""" - if not obj: - raise ObjectNotFound('Object %s Not found' % (obj)) - if isinstance(obj, Response): - obj = json.loads(obj.text) - if obj.get(0, None): - return obj[0]['uuid'] - elif obj.get('uuid', None): - return obj['uuid'] - elif obj.get('results', None): - return obj['results'][0]['uuid'] - else: - return None - - def _get_api_path(self, path, uuid=None): - """ - This function returns the full url from relative path and uuid. - """ - if path == 'logout': - return self.prefix + '/' + path - elif uuid: - return self.prefix + '/api/' + path + '/' + uuid - else: - return self.prefix + '/api/' + path - - def _get_uuid_by_name(self, path, name, tenant='admin', - tenant_uuid='', api_version=None): - """gets object by name and service path and returns uuid""" - resp = self.get_object_by_name( - path, name, tenant, tenant_uuid, api_version=api_version) - if not resp: - raise ObjectNotFound("%s/%s" % (path, name)) - return self.get_obj_uuid(resp) - - def _update_session_last_used(self): - if self.key in sessionDict: - sessionDict[self.key]["last_used"] = datetime.utcnow() - - @staticmethod - def _clean_inactive_sessions(): - """Removes sessions which are inactive more than 20 min""" - session_cache = sessionDict - logger.debug("cleaning inactive sessions in pid %d num elem %d", - os.getpid(), len(session_cache)) - keys_to_delete = [] - for key, session in list(session_cache.items()): - tdiff = avi_timedelta(datetime.utcnow() - session["last_used"]) - if tdiff < ApiSession.SESSION_CACHE_EXPIRY: - continue - keys_to_delete.append(key) - for key in keys_to_delete: - del session_cache[key] - logger.debug("Removed session for : %s", key) - - def delete_session(self): - """ Removes the session for cleanup""" - logger.debug("Removed session for : %s", self.key) - sessionDict.pop(self.key, None) - return -# End of file diff --git a/plugins/modules/avi_actiongroupconfig.py b/plugins/modules/avi_actiongroupconfig.py deleted file mode 120000 index 84caa3c1..00000000 --- a/plugins/modules/avi_actiongroupconfig.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_actiongroupconfig.py \ No newline at end of file diff --git a/plugins/modules/avi_alertconfig.py b/plugins/modules/avi_alertconfig.py deleted file mode 120000 index 42df98cc..00000000 --- a/plugins/modules/avi_alertconfig.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_alertconfig.py \ No newline at end of file diff --git a/plugins/modules/avi_alertemailconfig.py b/plugins/modules/avi_alertemailconfig.py deleted file mode 120000 index 3ef61f54..00000000 --- a/plugins/modules/avi_alertemailconfig.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_alertemailconfig.py \ No newline at end of file diff --git a/plugins/modules/avi_alertscriptconfig.py b/plugins/modules/avi_alertscriptconfig.py deleted file mode 120000 index 448dc7e2..00000000 --- a/plugins/modules/avi_alertscriptconfig.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_alertscriptconfig.py \ No newline at end of file diff --git a/plugins/modules/avi_alertsyslogconfig.py b/plugins/modules/avi_alertsyslogconfig.py deleted file mode 120000 index 0191598d..00000000 --- a/plugins/modules/avi_alertsyslogconfig.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_alertsyslogconfig.py \ No newline at end of file diff --git a/plugins/modules/avi_analyticsprofile.py b/plugins/modules/avi_analyticsprofile.py deleted file mode 120000 index 146f3848..00000000 --- a/plugins/modules/avi_analyticsprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_analyticsprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_api_session.py b/plugins/modules/avi_api_session.py deleted file mode 120000 index c8fcc38c..00000000 --- a/plugins/modules/avi_api_session.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_api_session.py \ No newline at end of file diff --git a/plugins/modules/avi_api_version.py b/plugins/modules/avi_api_version.py deleted file mode 120000 index 987b817a..00000000 --- a/plugins/modules/avi_api_version.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_api_version.py \ No newline at end of file diff --git a/plugins/modules/avi_applicationpersistenceprofile.py b/plugins/modules/avi_applicationpersistenceprofile.py deleted file mode 120000 index 386672b4..00000000 --- a/plugins/modules/avi_applicationpersistenceprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_applicationpersistenceprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_applicationprofile.py b/plugins/modules/avi_applicationprofile.py deleted file mode 120000 index 5c66d518..00000000 --- a/plugins/modules/avi_applicationprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_applicationprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_authprofile.py b/plugins/modules/avi_authprofile.py deleted file mode 120000 index d5a8fe4a..00000000 --- a/plugins/modules/avi_authprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_authprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_autoscalelaunchconfig.py b/plugins/modules/avi_autoscalelaunchconfig.py deleted file mode 120000 index 353ef3db..00000000 --- a/plugins/modules/avi_autoscalelaunchconfig.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_autoscalelaunchconfig.py \ No newline at end of file diff --git a/plugins/modules/avi_backup.py b/plugins/modules/avi_backup.py deleted file mode 120000 index 7d24992b..00000000 --- a/plugins/modules/avi_backup.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_backup.py \ No newline at end of file diff --git a/plugins/modules/avi_backupconfiguration.py b/plugins/modules/avi_backupconfiguration.py deleted file mode 120000 index 539cd354..00000000 --- a/plugins/modules/avi_backupconfiguration.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_backupconfiguration.py \ No newline at end of file diff --git a/plugins/modules/avi_certificatemanagementprofile.py b/plugins/modules/avi_certificatemanagementprofile.py deleted file mode 120000 index 3b799bba..00000000 --- a/plugins/modules/avi_certificatemanagementprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_certificatemanagementprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_cloud.py b/plugins/modules/avi_cloud.py deleted file mode 120000 index 9b8b4846..00000000 --- a/plugins/modules/avi_cloud.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_cloud.py \ No newline at end of file diff --git a/plugins/modules/avi_cloudconnectoruser.py b/plugins/modules/avi_cloudconnectoruser.py deleted file mode 120000 index 7b6b0345..00000000 --- a/plugins/modules/avi_cloudconnectoruser.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_cloudconnectoruser.py \ No newline at end of file diff --git a/plugins/modules/avi_cloudproperties.py b/plugins/modules/avi_cloudproperties.py deleted file mode 120000 index 8dbec3a7..00000000 --- a/plugins/modules/avi_cloudproperties.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_cloudproperties.py \ No newline at end of file diff --git a/plugins/modules/avi_cluster.py b/plugins/modules/avi_cluster.py deleted file mode 120000 index c6f71755..00000000 --- a/plugins/modules/avi_cluster.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_cluster.py \ No newline at end of file diff --git a/plugins/modules/avi_clusterclouddetails.py b/plugins/modules/avi_clusterclouddetails.py deleted file mode 120000 index cc0d4856..00000000 --- a/plugins/modules/avi_clusterclouddetails.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_clusterclouddetails.py \ No newline at end of file diff --git a/plugins/modules/avi_controllerproperties.py b/plugins/modules/avi_controllerproperties.py deleted file mode 120000 index a7abc19b..00000000 --- a/plugins/modules/avi_controllerproperties.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_controllerproperties.py \ No newline at end of file diff --git a/plugins/modules/avi_customipamdnsprofile.py b/plugins/modules/avi_customipamdnsprofile.py deleted file mode 120000 index 572c54f0..00000000 --- a/plugins/modules/avi_customipamdnsprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_customipamdnsprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_dnspolicy.py b/plugins/modules/avi_dnspolicy.py deleted file mode 120000 index af16af0f..00000000 --- a/plugins/modules/avi_dnspolicy.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_dnspolicy.py \ No newline at end of file diff --git a/plugins/modules/avi_errorpagebody.py b/plugins/modules/avi_errorpagebody.py deleted file mode 120000 index 41297c0e..00000000 --- a/plugins/modules/avi_errorpagebody.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_errorpagebody.py \ No newline at end of file diff --git a/plugins/modules/avi_errorpageprofile.py b/plugins/modules/avi_errorpageprofile.py deleted file mode 120000 index 832f151e..00000000 --- a/plugins/modules/avi_errorpageprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_errorpageprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_gslb.py b/plugins/modules/avi_gslb.py deleted file mode 120000 index 8303d3d0..00000000 --- a/plugins/modules/avi_gslb.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_gslb.py \ No newline at end of file diff --git a/plugins/modules/avi_gslbgeodbprofile.py b/plugins/modules/avi_gslbgeodbprofile.py deleted file mode 120000 index e0dba0b5..00000000 --- a/plugins/modules/avi_gslbgeodbprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_gslbgeodbprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_gslbservice.py b/plugins/modules/avi_gslbservice.py deleted file mode 120000 index bf506833..00000000 --- a/plugins/modules/avi_gslbservice.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_gslbservice.py \ No newline at end of file diff --git a/plugins/modules/avi_gslbservice_patch_member.py b/plugins/modules/avi_gslbservice_patch_member.py deleted file mode 120000 index 8e565ff7..00000000 --- a/plugins/modules/avi_gslbservice_patch_member.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_gslbservice_patch_member.py \ No newline at end of file diff --git a/plugins/modules/avi_hardwaresecuritymodulegroup.py b/plugins/modules/avi_hardwaresecuritymodulegroup.py deleted file mode 120000 index 4e53e1ed..00000000 --- a/plugins/modules/avi_hardwaresecuritymodulegroup.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_hardwaresecuritymodulegroup.py \ No newline at end of file diff --git a/plugins/modules/avi_healthmonitor.py b/plugins/modules/avi_healthmonitor.py deleted file mode 120000 index 37b015e7..00000000 --- a/plugins/modules/avi_healthmonitor.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_healthmonitor.py \ No newline at end of file diff --git a/plugins/modules/avi_httppolicyset.py b/plugins/modules/avi_httppolicyset.py deleted file mode 120000 index 8e627d01..00000000 --- a/plugins/modules/avi_httppolicyset.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_httppolicyset.py \ No newline at end of file diff --git a/plugins/modules/avi_ipaddrgroup.py b/plugins/modules/avi_ipaddrgroup.py deleted file mode 120000 index d88d8f61..00000000 --- a/plugins/modules/avi_ipaddrgroup.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_ipaddrgroup.py \ No newline at end of file diff --git a/plugins/modules/avi_ipamdnsproviderprofile.py b/plugins/modules/avi_ipamdnsproviderprofile.py deleted file mode 120000 index 9850e577..00000000 --- a/plugins/modules/avi_ipamdnsproviderprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_ipamdnsproviderprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_l4policyset.py b/plugins/modules/avi_l4policyset.py deleted file mode 120000 index 55c7a049..00000000 --- a/plugins/modules/avi_l4policyset.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_l4policyset.py \ No newline at end of file diff --git a/plugins/modules/avi_microservicegroup.py b/plugins/modules/avi_microservicegroup.py deleted file mode 120000 index e0477e46..00000000 --- a/plugins/modules/avi_microservicegroup.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_microservicegroup.py \ No newline at end of file diff --git a/plugins/modules/avi_network.py b/plugins/modules/avi_network.py deleted file mode 120000 index 191e9448..00000000 --- a/plugins/modules/avi_network.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_network.py \ No newline at end of file diff --git a/plugins/modules/avi_networkprofile.py b/plugins/modules/avi_networkprofile.py deleted file mode 120000 index b416bebc..00000000 --- a/plugins/modules/avi_networkprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_networkprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_networksecuritypolicy.py b/plugins/modules/avi_networksecuritypolicy.py deleted file mode 120000 index 0e99b261..00000000 --- a/plugins/modules/avi_networksecuritypolicy.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_networksecuritypolicy.py \ No newline at end of file diff --git a/plugins/modules/avi_pkiprofile.py b/plugins/modules/avi_pkiprofile.py deleted file mode 120000 index 0d69e1ec..00000000 --- a/plugins/modules/avi_pkiprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_pkiprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_pool.py b/plugins/modules/avi_pool.py deleted file mode 120000 index 4c7b4d53..00000000 --- a/plugins/modules/avi_pool.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_pool.py \ No newline at end of file diff --git a/plugins/modules/avi_poolgroup.py b/plugins/modules/avi_poolgroup.py deleted file mode 120000 index 74358144..00000000 --- a/plugins/modules/avi_poolgroup.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_poolgroup.py \ No newline at end of file diff --git a/plugins/modules/avi_poolgroupdeploymentpolicy.py b/plugins/modules/avi_poolgroupdeploymentpolicy.py deleted file mode 120000 index 53e56e78..00000000 --- a/plugins/modules/avi_poolgroupdeploymentpolicy.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_poolgroupdeploymentpolicy.py \ No newline at end of file diff --git a/plugins/modules/avi_prioritylabels.py b/plugins/modules/avi_prioritylabels.py deleted file mode 120000 index 9d8790b5..00000000 --- a/plugins/modules/avi_prioritylabels.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_prioritylabels.py \ No newline at end of file diff --git a/plugins/modules/avi_role.py b/plugins/modules/avi_role.py deleted file mode 120000 index 284e9a8b..00000000 --- a/plugins/modules/avi_role.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_role.py \ No newline at end of file diff --git a/plugins/modules/avi_scheduler.py b/plugins/modules/avi_scheduler.py deleted file mode 120000 index 1be9d968..00000000 --- a/plugins/modules/avi_scheduler.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_scheduler.py \ No newline at end of file diff --git a/plugins/modules/avi_seproperties.py b/plugins/modules/avi_seproperties.py deleted file mode 120000 index 0a485794..00000000 --- a/plugins/modules/avi_seproperties.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_seproperties.py \ No newline at end of file diff --git a/plugins/modules/avi_serverautoscalepolicy.py b/plugins/modules/avi_serverautoscalepolicy.py deleted file mode 120000 index 43195a3f..00000000 --- a/plugins/modules/avi_serverautoscalepolicy.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_serverautoscalepolicy.py \ No newline at end of file diff --git a/plugins/modules/avi_serviceengine.py b/plugins/modules/avi_serviceengine.py deleted file mode 120000 index f465dab5..00000000 --- a/plugins/modules/avi_serviceengine.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_serviceengine.py \ No newline at end of file diff --git a/plugins/modules/avi_serviceenginegroup.py b/plugins/modules/avi_serviceenginegroup.py deleted file mode 120000 index a2b01114..00000000 --- a/plugins/modules/avi_serviceenginegroup.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_serviceenginegroup.py \ No newline at end of file diff --git a/plugins/modules/avi_snmptrapprofile.py b/plugins/modules/avi_snmptrapprofile.py deleted file mode 120000 index c2adc103..00000000 --- a/plugins/modules/avi_snmptrapprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_snmptrapprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_sslkeyandcertificate.py b/plugins/modules/avi_sslkeyandcertificate.py deleted file mode 120000 index 9e623b82..00000000 --- a/plugins/modules/avi_sslkeyandcertificate.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_sslkeyandcertificate.py \ No newline at end of file diff --git a/plugins/modules/avi_sslprofile.py b/plugins/modules/avi_sslprofile.py deleted file mode 120000 index 4b6d15d0..00000000 --- a/plugins/modules/avi_sslprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_sslprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_stringgroup.py b/plugins/modules/avi_stringgroup.py deleted file mode 120000 index 63d5e4e5..00000000 --- a/plugins/modules/avi_stringgroup.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_stringgroup.py \ No newline at end of file diff --git a/plugins/modules/avi_systemconfiguration.py b/plugins/modules/avi_systemconfiguration.py deleted file mode 120000 index 70c77b6f..00000000 --- a/plugins/modules/avi_systemconfiguration.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_systemconfiguration.py \ No newline at end of file diff --git a/plugins/modules/avi_tenant.py b/plugins/modules/avi_tenant.py deleted file mode 120000 index 4ae0dd10..00000000 --- a/plugins/modules/avi_tenant.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_tenant.py \ No newline at end of file diff --git a/plugins/modules/avi_trafficcloneprofile.py b/plugins/modules/avi_trafficcloneprofile.py deleted file mode 120000 index 905e2048..00000000 --- a/plugins/modules/avi_trafficcloneprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_trafficcloneprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_user.py b/plugins/modules/avi_user.py deleted file mode 120000 index 6868e4e1..00000000 --- a/plugins/modules/avi_user.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_user.py \ No newline at end of file diff --git a/plugins/modules/avi_useraccount.py b/plugins/modules/avi_useraccount.py deleted file mode 120000 index 33c782d5..00000000 --- a/plugins/modules/avi_useraccount.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_useraccount.py \ No newline at end of file diff --git a/plugins/modules/avi_useraccountprofile.py b/plugins/modules/avi_useraccountprofile.py deleted file mode 120000 index c6eb252d..00000000 --- a/plugins/modules/avi_useraccountprofile.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_useraccountprofile.py \ No newline at end of file diff --git a/plugins/modules/avi_virtualservice.py b/plugins/modules/avi_virtualservice.py deleted file mode 120000 index 55418540..00000000 --- a/plugins/modules/avi_virtualservice.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_virtualservice.py \ No newline at end of file diff --git a/plugins/modules/avi_vrfcontext.py b/plugins/modules/avi_vrfcontext.py deleted file mode 120000 index 5c7bb937..00000000 --- a/plugins/modules/avi_vrfcontext.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_vrfcontext.py \ No newline at end of file diff --git a/plugins/modules/avi_vsdatascriptset.py b/plugins/modules/avi_vsdatascriptset.py deleted file mode 120000 index 9a683f5e..00000000 --- a/plugins/modules/avi_vsdatascriptset.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_vsdatascriptset.py \ No newline at end of file diff --git a/plugins/modules/avi_vsvip.py b/plugins/modules/avi_vsvip.py deleted file mode 120000 index 9e8a063f..00000000 --- a/plugins/modules/avi_vsvip.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_vsvip.py \ No newline at end of file diff --git a/plugins/modules/avi_webhook.py b/plugins/modules/avi_webhook.py deleted file mode 120000 index 2e5dcf4a..00000000 --- a/plugins/modules/avi_webhook.py +++ /dev/null @@ -1 +0,0 @@ -./network/avi/avi_webhook.py \ No newline at end of file diff --git a/plugins/modules/network/avi/avi_actiongroupconfig.py b/plugins/modules/network/avi/avi_actiongroupconfig.py deleted file mode 100644 index bfd07703..00000000 --- a/plugins/modules/network/avi/avi_actiongroupconfig.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_actiongroupconfig -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ActionGroupConfig Avi RESTful Object -description: - - This module is used to configure ActionGroupConfig object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - action_script_config_ref: - description: - - Reference of the action script configuration to be used. - - It is a reference to an object of type alertscriptconfig. - autoscale_trigger_notification: - description: - - Trigger notification to autoscale manager. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - description: - description: - - User defined description for the object. - email_config_ref: - description: - - Select the email notification configuration to use when sending alerts via email. - - It is a reference to an object of type alertemailconfig. - external_only: - description: - - Generate alert only to external destinations. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - required: true - type: bool - level: - description: - - When an alert is generated, mark its priority via the alert level. - - Enum options - ALERT_LOW, ALERT_MEDIUM, ALERT_HIGH. - - Default value when not specified in API or module is interpreted by Avi Controller as ALERT_LOW. - required: true - name: - description: - - Name of the object. - required: true - snmp_trap_profile_ref: - description: - - Select the snmp trap notification to use when sending alerts via snmp trap. - - It is a reference to an object of type snmptrapprofile. - syslog_config_ref: - description: - - Select the syslog notification configuration to use when sending alerts via syslog. - - It is a reference to an object of type alertsyslogconfig. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ActionGroupConfig object - community.network.avi_actiongroupconfig: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_actiongroupconfig -""" - -RETURN = ''' -obj: - description: ActionGroupConfig (api/actiongroupconfig) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - action_script_config_ref=dict(type='str',), - autoscale_trigger_notification=dict(type='bool',), - description=dict(type='str',), - email_config_ref=dict(type='str',), - external_only=dict(type='bool', required=True), - level=dict(type='str', required=True), - name=dict(type='str', required=True), - snmp_trap_profile_ref=dict(type='str',), - syslog_config_ref=dict(type='str',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'actiongroupconfig', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_alertconfig.py b/plugins/modules/network/avi/avi_alertconfig.py deleted file mode 100644 index 80a5f443..00000000 --- a/plugins/modules/network/avi/avi_alertconfig.py +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_alertconfig -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of AlertConfig Avi RESTful Object -description: - - This module is used to configure AlertConfig object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - action_group_ref: - description: - - The alert config will trigger the selected alert action, which can send notifications and execute a controlscript. - - It is a reference to an object of type actiongroupconfig. - alert_rule: - description: - - List of filters matching on events or client logs used for triggering alerts. - required: true - autoscale_alert: - description: - - This alert config applies to auto scale alerts. - type: bool - category: - description: - - Determines whether an alert is raised immediately when event occurs (realtime) or after specified number of events occurs within rolling time - - window. - - Enum options - REALTIME, ROLLINGWINDOW, WATERMARK. - - Default value when not specified in API or module is interpreted by Avi Controller as REALTIME. - required: true - description: - description: - - A custom description field. - enabled: - description: - - Enable or disable this alert config from generating new alerts. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - expiry_time: - description: - - An alert is expired and deleted after the expiry time has elapsed. - - The original event triggering the alert remains in the event's log. - - Allowed values are 1-31536000. - - Default value when not specified in API or module is interpreted by Avi Controller as 86400. - name: - description: - - Name of the alert configuration. - required: true - obj_uuid: - description: - - Uuid of the resource for which alert was raised. - object_type: - description: - - The object type to which the alert config is associated with. - - Valid object types are - virtual service, pool, service engine. - - Enum options - VIRTUALSERVICE, POOL, HEALTHMONITOR, NETWORKPROFILE, APPLICATIONPROFILE, HTTPPOLICYSET, DNSPOLICY, SECURITYPOLICY, IPADDRGROUP, - - STRINGGROUP, SSLPROFILE, SSLKEYANDCERTIFICATE, NETWORKSECURITYPOLICY, APPLICATIONPERSISTENCEPROFILE, ANALYTICSPROFILE, VSDATASCRIPTSET, TENANT, - - PKIPROFILE, AUTHPROFILE, CLOUD, SERVERAUTOSCALEPOLICY, AUTOSCALELAUNCHCONFIG, MICROSERVICEGROUP, IPAMPROFILE, HARDWARESECURITYMODULEGROUP, - - POOLGROUP, PRIORITYLABELS, POOLGROUPDEPLOYMENTPOLICY, GSLBSERVICE, GSLBSERVICERUNTIME, SCHEDULER, GSLBGEODBPROFILE, - - GSLBAPPLICATIONPERSISTENCEPROFILE, TRAFFICCLONEPROFILE, VSVIP, WAFPOLICY, WAFPROFILE, ERRORPAGEPROFILE, ERRORPAGEBODY, L4POLICYSET, - - GSLBSERVICERUNTIMEBATCH, WAFPOLICYPSMGROUP, PINGACCESSAGENT, SERVICEENGINEPOLICY, NATPOLICY, SSOPOLICY, PROTOCOLPARSER, SERVICEENGINE, - - DEBUGSERVICEENGINE, DEBUGCONTROLLER, DEBUGVIRTUALSERVICE, SERVICEENGINEGROUP, SEPROPERTIES, NETWORK, CONTROLLERNODE, CONTROLLERPROPERTIES, - - SYSTEMCONFIGURATION, VRFCONTEXT, USER, ALERTCONFIG, ALERTSYSLOGCONFIG, ALERTEMAILCONFIG, ALERTTYPECONFIG, APPLICATION, ROLE, CLOUDPROPERTIES, - - SNMPTRAPPROFILE, ACTIONGROUPPROFILE, MICROSERVICE, ALERTPARAMS, ACTIONGROUPCONFIG, CLOUDCONNECTORUSER, GSLB, GSLBDNSUPDATE, GSLBSITEOPS, - - GLBMGRWARMSTART, IPAMDNSRECORD, GSLBDNSGSSTATUS, GSLBDNSGEOFILEOPS, GSLBDNSGEOUPDATE, GSLBDNSGEOCLUSTEROPS, GSLBDNSCLEANUP, GSLBSITEOPSRESYNC, - - IPAMDNSPROVIDERPROFILE, TCPSTATRUNTIME, UDPSTATRUNTIME, IPSTATRUNTIME, ARPSTATRUNTIME, MBSTATRUNTIME, IPSTKQSTATSRUNTIME, MALLOCSTATRUNTIME, - - SHMALLOCSTATRUNTIME, CPUUSAGERUNTIME, L7GLOBALSTATSRUNTIME, L7VIRTUALSERVICESTATSRUNTIME, SEAGENTVNICDBRUNTIME, SEAGENTGRAPHDBRUNTIME, - - SEAGENTSTATERUNTIME, INTERFACERUNTIME, ARPTABLERUNTIME, DISPATCHERSTATRUNTIME, DISPATCHERSTATCLEARRUNTIME, DISPATCHERTABLEDUMPRUNTIME, - - DISPATCHERREMOTETIMERLISTDUMPRUNTIME, METRICSAGENTMESSAGE, HEALTHMONITORSTATRUNTIME, METRICSENTITYRUNTIME, PERSISTENCEINTERNAL, - - HTTPPOLICYSETINTERNAL, DNSPOLICYINTERNAL, CONNECTIONDUMPRUNTIME, SHAREDDBSTATS, SHAREDDBSTATSCLEAR, ICMPSTATRUNTIME, ROUTETABLERUNTIME, - - VIRTUALMACHINE, POOLSERVER, SEVSLIST, MEMINFORUNTIME, RTERINGSTATRUNTIME, ALGOSTATRUNTIME, HEALTHMONITORRUNTIME, CPUSTATRUNTIME, SEVM, HOST, - - PORTGROUP, CLUSTER, DATACENTER, VCENTER, HTTPPOLICYSETSTATS, DNSPOLICYSTATS, METRICSSESTATS, RATELIMITERSTATRUNTIME, NETWORKSECURITYPOLICYSTATS, - - TCPCONNRUNTIME, POOLSTATS, CONNPOOLINTERNAL, CONNPOOLSTATS, VSHASHSHOWRUNTIME, SELOGSTATSRUNTIME, NETWORKSECURITYPOLICYDETAIL, LICENSERUNTIME, - - SERVERRUNTIME, METRICSRUNTIMESUMMARY, METRICSRUNTIMEDETAIL, DISPATCHERSEHMPROBETEMPDISABLERUNTIME, POOLDEBUG, VSLOGMGRMAP, SERUMINSERTIONSTATS, - - HTTPCACHE, HTTPCACHESTATS, SEDOSSTATRUNTIME, VSDOSSTATRUNTIME, SERVERUPDATEREQ, VSSCALEOUTLIST, SEMEMDISTRUNTIME, TCPCONNRUNTIMEDETAIL, - - SEUPGRADESTATUS, SEUPGRADEPREVIEW, SEFAULTINJECTEXHAUSTM, SEFAULTINJECTEXHAUSTMCL, SEFAULTINJECTEXHAUSTMCLSMALL, SEFAULTINJECTEXHAUSTCONN, - - SEHEADLESSONLINEREQ, SEUPGRADE, SEUPGRADESTATUSDETAIL, SERESERVEDVS, SERESERVEDVSCLEAR, VSCANDIDATESEHOSTLIST, SEGROUPUPGRADE, REBALANCE, - - SEGROUPREBALANCE, SEAUTHSTATSRUNTIME, AUTOSCALESTATE, VIRTUALSERVICEAUTHSTATS, NETWORKSECURITYPOLICYDOS, KEYVALINTERNAL, KEYVALSUMMARYINTERNAL, - - SERVERSTATEUPDATEINFO, CLTRACKINTERNAL, CLTRACKSUMMARYINTERNAL, MICROSERVICERUNTIME, SEMICROSERVICE, VIRTUALSERVICEANALYSIS, CLIENTINTERNAL, - - CLIENTSUMMARYINTERNAL, MICROSERVICEGROUPRUNTIME, BGPRUNTIME, REQUESTQUEUERUNTIME, MIGRATEALL, MIGRATEALLSTATUSSUMMARY, MIGRATEALLSTATUSDETAIL, - - INTERFACESUMMARYRUNTIME, INTERFACELACPRUNTIME, DNSTABLE, GSLBSERVICEDETAIL, GSLBSERVICEINTERNAL, GSLBSERVICEHMONSTAT, SETROLESREQUEST, - - TRAFFICCLONERUNTIME, GEOLOCATIONINFO, SEVSHBSTATRUNTIME, GEODBINTERNAL, GSLBSITEINTERNAL, WAFSTATS, USERDEFINEDDATASCRIPTCOUNTERS, LLDPRUNTIME, - - VSESSHARINGPOOL, NDTABLERUNTIME, IP6STATRUNTIME, ICMP6STATRUNTIME, SEVSSPLACEMENT, L4POLICYSETSTATS, L4POLICYSETINTERNAL, BGPDEBUGINFO, SHARD, - - CPUSTATRUNTIMEDETAIL, SEASSERTSTATRUNTIME, SEFAULTINJECTINFRA, SEAGENTASSERTSTATRUNTIME, SEDATASTORESTATUS, DIFFQUEUESTATUS, IP6ROUTETABLERUNTIME, - - SECURITYMGRSTATE, VIRTUALSERVICESESCALEOUTSTATUS, SHARDSERVERSTATUS, SEAGENTSHARDCLIENTRESOURCEMAP, SEAGENTCONSISTENTHASH, SEAGENTVNICDBHISTORY, - - SEAGENTSHARDCLIENTAPPMAP, SEAGENTSHARDCLIENTEVENTHISTORY, SENATSTATRUNTIME, SENATFLOWRUNTIME, SERESOURCEPROTO, SECONSUMERPROTO, - - SECREATEPENDINGPROTO, PLACEMENTSTATS, SEVIPPROTO, RMVRFPROTO, VCENTERMAP, VIMGRVCENTERRUNTIME, INTERESTEDVMS, INTERESTEDHOSTS, - - VCENTERSUPPORTEDCOUNTERS, ENTITYCOUNTERS, TRANSACTIONSTATS, SEVMCREATEPROGRESS, PLACEMENTSTATUS, VISUBFOLDERS, VIDATASTORE, VIHOSTRESOURCES, - - CLOUDCONNECTOR, VINETWORKSUBNETVMS, VIDATASTORECONTENTS, VIMGRVCENTERCLOUDRUNTIME, VIVCENTERPORTGROUPS, VIVCENTERDATACENTERS, VIMGRHOSTRUNTIME, - - PLACEMENTGLOBALS, APICCONFIGURATION, CIFTABLE, APICTRANSACTION, VIRTUALSERVICESTATEDBCACHESUMMARY, POOLSTATEDBCACHESUMMARY, - - SERVERSTATEDBCACHESUMMARY, APICAGENTINTERNAL, APICTRANSACTIONFLAP, APICGRAPHINSTANCES, APICEPGS, APICEPGEPS, APICDEVICEPKGVER, APICTENANTS, - - APICVMMDOMAINS, NSXCONFIGURATION, NSXSGTABLE, NSXAGENTINTERNAL, NSXSGINFO, NSXSGIPS, NSXAGENTINTERNALCLI, MAXOBJECTS. - recommendation: - description: - - Recommendation of alertconfig. - rolling_window: - description: - - Only if the number of events is reached or exceeded within the time window will an alert be generated. - - Allowed values are 1-31536000. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - source: - description: - - Signifies system events or the type of client logsused in this alert configuration. - - Enum options - CONN_LOGS, APP_LOGS, EVENT_LOGS, METRICS. - required: true - summary: - description: - - Summary of reason why alert is generated. - tenant_ref: - description: - - It is a reference to an object of type tenant. - threshold: - description: - - An alert is created only when the number of events meets or exceeds this number within the chosen time frame. - - Allowed values are 1-65536. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - throttle: - description: - - Alerts are suppressed (throttled) for this duration of time since the last alert was raised for this alert config. - - Allowed values are 0-31536000. - - Default value when not specified in API or module is interpreted by Avi Controller as 600. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create AlertConfig object - community.network.avi_alertconfig: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_alertconfig -""" - -RETURN = ''' -obj: - description: AlertConfig (api/alertconfig) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - action_group_ref=dict(type='str',), - alert_rule=dict(type='dict', required=True), - autoscale_alert=dict(type='bool',), - category=dict(type='str', required=True), - description=dict(type='str',), - enabled=dict(type='bool',), - expiry_time=dict(type='int',), - name=dict(type='str', required=True), - obj_uuid=dict(type='str',), - object_type=dict(type='str',), - recommendation=dict(type='str',), - rolling_window=dict(type='int',), - source=dict(type='str', required=True), - summary=dict(type='str',), - tenant_ref=dict(type='str',), - threshold=dict(type='int',), - throttle=dict(type='int',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'alertconfig', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_alertemailconfig.py b/plugins/modules/network/avi/avi_alertemailconfig.py deleted file mode 100644 index b460a76e..00000000 --- a/plugins/modules/network/avi/avi_alertemailconfig.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_alertemailconfig -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of AlertEmailConfig Avi RESTful Object -description: - - This module is used to configure AlertEmailConfig object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cc_emails: - description: - - Alerts are copied to the comma separated list of email recipients. - description: - description: - - User defined description for the object. - name: - description: - - A user-friendly name of the email notification service. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - to_emails: - description: - - Alerts are sent to the comma separated list of email recipients. - required: true - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create AlertEmailConfig object - community.network.avi_alertemailconfig: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_alertemailconfig -""" - -RETURN = ''' -obj: - description: AlertEmailConfig (api/alertemailconfig) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cc_emails=dict(type='str',), - description=dict(type='str',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - to_emails=dict(type='str', required=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'alertemailconfig', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_alertscriptconfig.py b/plugins/modules/network/avi/avi_alertscriptconfig.py deleted file mode 100644 index 95868c89..00000000 --- a/plugins/modules/network/avi/avi_alertscriptconfig.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_alertscriptconfig -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of AlertScriptConfig Avi RESTful Object -description: - - This module is used to configure AlertScriptConfig object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - action_script: - description: - - User defined alert action script. - - Please refer to kb.avinetworks.com for more information. - name: - description: - - A user-friendly name of the script. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create Alert Script to perform AWS server autoscaling - community.network.avi_alertscriptconfig: - username: '{{ username }}' - controller: '{{ controller }}' - password: '{{ password }}' - action_script: "echo Hello" - name: AWS-Launch-Script - tenant_ref: Demo -""" - -RETURN = ''' -obj: - description: AlertScriptConfig (api/alertscriptconfig) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - action_script=dict(type='str',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'alertscriptconfig', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_alertsyslogconfig.py b/plugins/modules/network/avi/avi_alertsyslogconfig.py deleted file mode 100644 index d6bd4a0a..00000000 --- a/plugins/modules/network/avi/avi_alertsyslogconfig.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_alertsyslogconfig -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of AlertSyslogConfig Avi RESTful Object -description: - - This module is used to configure AlertSyslogConfig object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - description: - description: - - User defined description for alert syslog config. - name: - description: - - A user-friendly name of the syslog notification. - required: true - syslog_servers: - description: - - The list of syslog servers. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create Alert Syslog object to forward all events to external syslog server - community.network.avi_alertsyslogconfig: - controller: '{{ controller }}' - name: Roberts-syslog - password: '{{ password }}' - syslog_servers: - - syslog_server: 10.10.0.100 - syslog_server_port: 514 - udp: true - tenant_ref: admin - username: '{{ username }}' -""" - -RETURN = ''' -obj: - description: AlertSyslogConfig (api/alertsyslogconfig) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - description=dict(type='str',), - name=dict(type='str', required=True), - syslog_servers=dict(type='list',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'alertsyslogconfig', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_analyticsprofile.py b/plugins/modules/network/avi/avi_analyticsprofile.py deleted file mode 100644 index 079ec4c5..00000000 --- a/plugins/modules/network/avi/avi_analyticsprofile.py +++ /dev/null @@ -1,610 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_analyticsprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of AnalyticsProfile Avi RESTful Object -description: - - This module is used to configure AnalyticsProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - apdex_response_threshold: - description: - - If a client receives an http response in less than the satisfactory latency threshold, the request is considered satisfied. - - It is considered tolerated if it is not satisfied and less than tolerated latency factor multiplied by the satisfactory latency threshold. - - Greater than this number and the client's request is considered frustrated. - - Allowed values are 1-30000. - - Default value when not specified in API or module is interpreted by Avi Controller as 500. - apdex_response_tolerated_factor: - description: - - Client tolerated response latency factor. - - Client must receive a response within this factor times the satisfactory threshold (apdex_response_threshold) to be considered tolerated. - - Allowed values are 1-1000. - - Default value when not specified in API or module is interpreted by Avi Controller as 4.0. - apdex_rtt_threshold: - description: - - Satisfactory client to avi round trip time(rtt). - - Allowed values are 1-2000. - - Default value when not specified in API or module is interpreted by Avi Controller as 250. - apdex_rtt_tolerated_factor: - description: - - Tolerated client to avi round trip time(rtt) factor. - - It is a multiple of apdex_rtt_tolerated_factor. - - Allowed values are 1-1000. - - Default value when not specified in API or module is interpreted by Avi Controller as 4.0. - apdex_rum_threshold: - description: - - If a client is able to load a page in less than the satisfactory latency threshold, the pageload is considered satisfied. - - It is considered tolerated if it is greater than satisfied but less than the tolerated latency multiplied by satisfied latency. - - Greater than this number and the client's request is considered frustrated. - - A pageload includes the time for dns lookup, download of all http objects, and page render time. - - Allowed values are 1-30000. - - Default value when not specified in API or module is interpreted by Avi Controller as 5000. - apdex_rum_tolerated_factor: - description: - - Virtual service threshold factor for tolerated page load time (plt) as multiple of apdex_rum_threshold. - - Allowed values are 1-1000. - - Default value when not specified in API or module is interpreted by Avi Controller as 4.0. - apdex_server_response_threshold: - description: - - A server http response is considered satisfied if latency is less than the satisfactory latency threshold. - - The response is considered tolerated when it is greater than satisfied but less than the tolerated latency factor * s_latency. - - Greater than this number and the server response is considered frustrated. - - Allowed values are 1-30000. - - Default value when not specified in API or module is interpreted by Avi Controller as 400. - apdex_server_response_tolerated_factor: - description: - - Server tolerated response latency factor. - - Servermust response within this factor times the satisfactory threshold (apdex_server_response_threshold) to be considered tolerated. - - Allowed values are 1-1000. - - Default value when not specified in API or module is interpreted by Avi Controller as 4.0. - apdex_server_rtt_threshold: - description: - - Satisfactory client to avi round trip time(rtt). - - Allowed values are 1-2000. - - Default value when not specified in API or module is interpreted by Avi Controller as 125. - apdex_server_rtt_tolerated_factor: - description: - - Tolerated client to avi round trip time(rtt) factor. - - It is a multiple of apdex_rtt_tolerated_factor. - - Allowed values are 1-1000. - - Default value when not specified in API or module is interpreted by Avi Controller as 4.0. - client_log_config: - description: - - Configure which logs are sent to the avi controller from ses and how they are processed. - client_log_streaming_config: - description: - - Configure to stream logs to an external server. - - Field introduced in 17.1.1. - conn_lossy_ooo_threshold: - description: - - A connection between client and avi is considered lossy when more than this percentage of out of order packets are received. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 50. - conn_lossy_timeo_rexmt_threshold: - description: - - A connection between client and avi is considered lossy when more than this percentage of packets are retransmitted due to timeout. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - conn_lossy_total_rexmt_threshold: - description: - - A connection between client and avi is considered lossy when more than this percentage of packets are retransmitted. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 50. - conn_lossy_zero_win_size_event_threshold: - description: - - A client connection is considered lossy when percentage of times a packet could not be transmitted due to tcp zero window is above this threshold. - - Allowed values are 0-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 2. - conn_server_lossy_ooo_threshold: - description: - - A connection between avi and server is considered lossy when more than this percentage of out of order packets are received. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 50. - conn_server_lossy_timeo_rexmt_threshold: - description: - - A connection between avi and server is considered lossy when more than this percentage of packets are retransmitted due to timeout. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - conn_server_lossy_total_rexmt_threshold: - description: - - A connection between avi and server is considered lossy when more than this percentage of packets are retransmitted. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 50. - conn_server_lossy_zero_win_size_event_threshold: - description: - - A server connection is considered lossy when percentage of times a packet could not be transmitted due to tcp zero window is above this threshold. - - Allowed values are 0-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 2. - description: - description: - - User defined description for the object. - disable_ondemand_metrics: - description: - - Virtual service (vs) metrics are processed only when there is live data traffic on the vs. - - In case, vs is idle for a period of time as specified by ondemand_metrics_idle_timeout then metrics processing is suspended for that vs. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - disable_se_analytics: - description: - - Disable node (service engine) level analytics forvs metrics. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - disable_server_analytics: - description: - - Disable analytics on backend servers. - - This may be desired in container environment when there are large number of ephemeral servers. - - Additionally, no healthscore of servers is computed when server analytics is disabled. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - disable_vs_analytics: - description: - - Disable virtualservice (frontend) analytics. - - This flag disables metrics and healthscore for virtualservice. - - Field introduced in 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - enable_advanced_analytics: - description: - - Enables advanced analytics features like anomaly detection. - - If set to false, anomaly computation (and associated rules/events) for vs, pool and server metrics will be disabled. - - However, setting it to false reduces cpu and memory requirements for analytics subsystem. - - Field introduced in 17.2.13, 18.1.5, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - exclude_client_close_before_request_as_error: - description: - - Exclude client closed connection before an http request could be completed from being classified as an error. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_dns_policy_drop_as_significant: - description: - - Exclude dns policy drops from the list of errors. - - Field introduced in 17.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_gs_down_as_error: - description: - - Exclude queries to gslb services that are operationally down from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_http_error_codes: - description: - - List of http status codes to be excluded from being classified as an error. - - Error connections or responses impacts health score, are included as significant logs, and may be classified as part of a dos attack. - exclude_invalid_dns_domain_as_error: - description: - - Exclude dns queries to domains outside the domains configured in the dns application profile from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_invalid_dns_query_as_error: - description: - - Exclude invalid dns queries from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_no_dns_record_as_error: - description: - - Exclude queries to domains that did not have configured services/records from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_no_valid_gs_member_as_error: - description: - - Exclude queries to gslb services that have no available members from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_persistence_change_as_error: - description: - - Exclude persistence server changed while load balancing' from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_server_dns_error_as_error: - description: - - Exclude server dns error response from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_server_tcp_reset_as_error: - description: - - Exclude server tcp reset from errors. - - It is common for applications like ms exchange. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_sip_error_codes: - description: - - List of sip status codes to be excluded from being classified as an error. - - Field introduced in 17.2.13, 18.1.5, 18.2.1. - exclude_syn_retransmit_as_error: - description: - - Exclude 'server unanswered syns' from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_tcp_reset_as_error: - description: - - Exclude tcp resets by client from the list of potential errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - exclude_unsupported_dns_query_as_error: - description: - - Exclude unsupported dns queries from the list of errors. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - healthscore_max_server_limit: - description: - - Skips health score computation of pool servers when number of servers in a pool is more than this setting. - - Allowed values are 0-5000. - - Special values are 0- 'server health score is disabled'. - - Field introduced in 17.2.13, 18.1.4. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - hs_event_throttle_window: - description: - - Time window (in secs) within which only unique health change events should occur. - - Default value when not specified in API or module is interpreted by Avi Controller as 1209600. - hs_max_anomaly_penalty: - description: - - Maximum penalty that may be deducted from health score for anomalies. - - Allowed values are 0-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - hs_max_resources_penalty: - description: - - Maximum penalty that may be deducted from health score for high resource utilization. - - Allowed values are 0-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 25. - hs_max_security_penalty: - description: - - Maximum penalty that may be deducted from health score based on security assessment. - - Allowed values are 0-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 100. - hs_min_dos_rate: - description: - - Dos connection rate below which the dos security assessment will not kick in. - - Default value when not specified in API or module is interpreted by Avi Controller as 1000. - hs_performance_boost: - description: - - Adds free performance score credits to health score. - - It can be used for compensating health score for known slow applications. - - Allowed values are 0-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - hs_pscore_traffic_threshold_l4_client: - description: - - Threshold number of connections in 5min, below which apdexr, apdexc, rum_apdex, and other network quality metrics are not computed. - - Default value when not specified in API or module is interpreted by Avi Controller as 10.0. - hs_pscore_traffic_threshold_l4_server: - description: - - Threshold number of connections in 5min, below which apdexr, apdexc, rum_apdex, and other network quality metrics are not computed. - - Default value when not specified in API or module is interpreted by Avi Controller as 10.0. - hs_security_certscore_expired: - description: - - Score assigned when the certificate has expired. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 0.0. - hs_security_certscore_gt30d: - description: - - Score assigned when the certificate expires in more than 30 days. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 5.0. - hs_security_certscore_le07d: - description: - - Score assigned when the certificate expires in less than or equal to 7 days. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 2.0. - hs_security_certscore_le30d: - description: - - Score assigned when the certificate expires in less than or equal to 30 days. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 4.0. - hs_security_chain_invalidity_penalty: - description: - - Penalty for allowing certificates with invalid chain. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 1.0. - hs_security_cipherscore_eq000b: - description: - - Score assigned when the minimum cipher strength is 0 bits. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 0.0. - hs_security_cipherscore_ge128b: - description: - - Score assigned when the minimum cipher strength is greater than equal to 128 bits. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 5.0. - hs_security_cipherscore_lt128b: - description: - - Score assigned when the minimum cipher strength is less than 128 bits. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 3.5. - hs_security_encalgo_score_none: - description: - - Score assigned when no algorithm is used for encryption. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 0.0. - hs_security_encalgo_score_rc4: - description: - - Score assigned when rc4 algorithm is used for encryption. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 2.5. - hs_security_hsts_penalty: - description: - - Penalty for not enabling hsts. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 1.0. - hs_security_nonpfs_penalty: - description: - - Penalty for allowing non-pfs handshakes. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 1.0. - hs_security_selfsignedcert_penalty: - description: - - Deprecated. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 1.0. - hs_security_ssl30_score: - description: - - Score assigned when supporting ssl3.0 encryption protocol. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 3.5. - hs_security_tls10_score: - description: - - Score assigned when supporting tls1.0 encryption protocol. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 5.0. - hs_security_tls11_score: - description: - - Score assigned when supporting tls1.1 encryption protocol. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 5.0. - hs_security_tls12_score: - description: - - Score assigned when supporting tls1.2 encryption protocol. - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 5.0. - hs_security_weak_signature_algo_penalty: - description: - - Penalty for allowing weak signature algorithm(s). - - Allowed values are 0-5. - - Default value when not specified in API or module is interpreted by Avi Controller as 1.0. - name: - description: - - The name of the analytics profile. - required: true - ondemand_metrics_idle_timeout: - description: - - This flag sets the time duration of no live data traffic after which virtual service metrics processing is suspended. - - It is applicable only when disable_ondemand_metrics is set to false. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 1800. - ranges: - description: - - List of http status code ranges to be excluded from being classified as an error. - resp_code_block: - description: - - Block of http response codes to be excluded from being classified as an error. - - Enum options - AP_HTTP_RSP_4XX, AP_HTTP_RSP_5XX. - sensitive_log_profile: - description: - - Rules applied to the http application log for filtering sensitive information. - - Field introduced in 17.2.10, 18.1.2. - sip_log_depth: - description: - - Maximum number of sip messages added in logs for a sip transaction. - - By default, this value is 20. - - Allowed values are 1-1000. - - Field introduced in 17.2.13, 18.1.5, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the analytics profile. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create a custom Analytics profile object - community.network.avi_analyticsprofile: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - apdex_response_threshold: 500 - apdex_response_tolerated_factor: 4.0 - apdex_rtt_threshold: 250 - apdex_rtt_tolerated_factor: 4.0 - apdex_rum_threshold: 5000 - apdex_rum_tolerated_factor: 4.0 - apdex_server_response_threshold: 400 - apdex_server_response_tolerated_factor: 4.0 - apdex_server_rtt_threshold: 125 - apdex_server_rtt_tolerated_factor: 4.0 - conn_lossy_ooo_threshold: 50 - conn_lossy_timeo_rexmt_threshold: 20 - conn_lossy_total_rexmt_threshold: 50 - conn_lossy_zero_win_size_event_threshold: 2 - conn_server_lossy_ooo_threshold: 50 - conn_server_lossy_timeo_rexmt_threshold: 20 - conn_server_lossy_total_rexmt_threshold: 50 - conn_server_lossy_zero_win_size_event_threshold: 2 - disable_se_analytics: false - disable_server_analytics: false - exclude_client_close_before_request_as_error: false - exclude_persistence_change_as_error: false - exclude_server_tcp_reset_as_error: false - exclude_syn_retransmit_as_error: false - exclude_tcp_reset_as_error: false - hs_event_throttle_window: 1209600 - hs_max_anomaly_penalty: 10 - hs_max_resources_penalty: 25 - hs_max_security_penalty: 100 - hs_min_dos_rate: 1000 - hs_performance_boost: 20 - hs_pscore_traffic_threshold_l4_client: 10.0 - hs_pscore_traffic_threshold_l4_server: 10.0 - hs_security_certscore_expired: 0.0 - hs_security_certscore_gt30d: 5.0 - hs_security_certscore_le07d: 2.0 - hs_security_certscore_le30d: 4.0 - hs_security_chain_invalidity_penalty: 1.0 - hs_security_cipherscore_eq000b: 0.0 - hs_security_cipherscore_ge128b: 5.0 - hs_security_cipherscore_lt128b: 3.5 - hs_security_encalgo_score_none: 0.0 - hs_security_encalgo_score_rc4: 2.5 - hs_security_hsts_penalty: 0.0 - hs_security_nonpfs_penalty: 1.0 - hs_security_selfsignedcert_penalty: 1.0 - hs_security_ssl30_score: 3.5 - hs_security_tls10_score: 5.0 - hs_security_tls11_score: 5.0 - hs_security_tls12_score: 5.0 - hs_security_weak_signature_algo_penalty: 1.0 - name: jason-analytics-profile - tenant_ref: Demo -""" - -RETURN = ''' -obj: - description: AnalyticsProfile (api/analyticsprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - apdex_response_threshold=dict(type='int',), - apdex_response_tolerated_factor=dict(type='float',), - apdex_rtt_threshold=dict(type='int',), - apdex_rtt_tolerated_factor=dict(type='float',), - apdex_rum_threshold=dict(type='int',), - apdex_rum_tolerated_factor=dict(type='float',), - apdex_server_response_threshold=dict(type='int',), - apdex_server_response_tolerated_factor=dict(type='float',), - apdex_server_rtt_threshold=dict(type='int',), - apdex_server_rtt_tolerated_factor=dict(type='float',), - client_log_config=dict(type='dict',), - client_log_streaming_config=dict(type='dict',), - conn_lossy_ooo_threshold=dict(type='int',), - conn_lossy_timeo_rexmt_threshold=dict(type='int',), - conn_lossy_total_rexmt_threshold=dict(type='int',), - conn_lossy_zero_win_size_event_threshold=dict(type='int',), - conn_server_lossy_ooo_threshold=dict(type='int',), - conn_server_lossy_timeo_rexmt_threshold=dict(type='int',), - conn_server_lossy_total_rexmt_threshold=dict(type='int',), - conn_server_lossy_zero_win_size_event_threshold=dict(type='int',), - description=dict(type='str',), - disable_ondemand_metrics=dict(type='bool',), - disable_se_analytics=dict(type='bool',), - disable_server_analytics=dict(type='bool',), - disable_vs_analytics=dict(type='bool',), - enable_advanced_analytics=dict(type='bool',), - exclude_client_close_before_request_as_error=dict(type='bool',), - exclude_dns_policy_drop_as_significant=dict(type='bool',), - exclude_gs_down_as_error=dict(type='bool',), - exclude_http_error_codes=dict(type='list',), - exclude_invalid_dns_domain_as_error=dict(type='bool',), - exclude_invalid_dns_query_as_error=dict(type='bool',), - exclude_no_dns_record_as_error=dict(type='bool',), - exclude_no_valid_gs_member_as_error=dict(type='bool',), - exclude_persistence_change_as_error=dict(type='bool',), - exclude_server_dns_error_as_error=dict(type='bool',), - exclude_server_tcp_reset_as_error=dict(type='bool',), - exclude_sip_error_codes=dict(type='list',), - exclude_syn_retransmit_as_error=dict(type='bool',), - exclude_tcp_reset_as_error=dict(type='bool',), - exclude_unsupported_dns_query_as_error=dict(type='bool',), - healthscore_max_server_limit=dict(type='int',), - hs_event_throttle_window=dict(type='int',), - hs_max_anomaly_penalty=dict(type='int',), - hs_max_resources_penalty=dict(type='int',), - hs_max_security_penalty=dict(type='int',), - hs_min_dos_rate=dict(type='int',), - hs_performance_boost=dict(type='int',), - hs_pscore_traffic_threshold_l4_client=dict(type='float',), - hs_pscore_traffic_threshold_l4_server=dict(type='float',), - hs_security_certscore_expired=dict(type='float',), - hs_security_certscore_gt30d=dict(type='float',), - hs_security_certscore_le07d=dict(type='float',), - hs_security_certscore_le30d=dict(type='float',), - hs_security_chain_invalidity_penalty=dict(type='float',), - hs_security_cipherscore_eq000b=dict(type='float',), - hs_security_cipherscore_ge128b=dict(type='float',), - hs_security_cipherscore_lt128b=dict(type='float',), - hs_security_encalgo_score_none=dict(type='float',), - hs_security_encalgo_score_rc4=dict(type='float',), - hs_security_hsts_penalty=dict(type='float',), - hs_security_nonpfs_penalty=dict(type='float',), - hs_security_selfsignedcert_penalty=dict(type='float',), - hs_security_ssl30_score=dict(type='float',), - hs_security_tls10_score=dict(type='float',), - hs_security_tls11_score=dict(type='float',), - hs_security_tls12_score=dict(type='float',), - hs_security_weak_signature_algo_penalty=dict(type='float',), - name=dict(type='str', required=True), - ondemand_metrics_idle_timeout=dict(type='int',), - ranges=dict(type='list',), - resp_code_block=dict(type='list',), - sensitive_log_profile=dict(type='dict',), - sip_log_depth=dict(type='int',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'analyticsprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_api_session.py b/plugins/modules/network/avi/avi_api_session.py deleted file mode 100644 index 147e7c07..00000000 --- a/plugins/modules/network/avi/avi_api_session.py +++ /dev/null @@ -1,256 +0,0 @@ -#!/usr/bin/python -""" -# Created on Aug 12, 2016 -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 -# -# module_check: not supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# -""" - - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_api_session -author: Gaurav Rastogi (@grastogi23) - -short_description: Avi API Module -description: - - This module can be used for calling any resources defined in Avi REST API. U(https://avinetworks.com/) - - This module is useful for invoking HTTP Patch methods and accessing resources that do not have an REST object associated with them. -requirements: [ avisdk ] -options: - http_method: - description: - - Allowed HTTP methods for RESTful services and are supported by Avi Controller. - choices: ["get", "put", "post", "patch", "delete"] - required: true - data: - description: - - HTTP body in YAML or JSON format. - params: - description: - - Query parameters passed to the HTTP API. - path: - description: - - 'Path for Avi API resource. For example, C(path: virtualservice) will translate to C(api/virtualserivce).' - timeout: - description: - - Timeout (in seconds) for Avi API calls. - default: 60 -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = ''' - - - name: Get Pool Information using avi_api_session - community.network.avi_api_session: - controller: "{{ controller }}" - username: "{{ username }}" - password: "{{ password }}" - http_method: get - path: pool - params: - name: "{{ pool_name }}" - api_version: 16.4 - register: pool_results - - - name: Patch Pool with list of servers - community.network.avi_api_session: - controller: "{{ controller }}" - username: "{{ username }}" - password: "{{ password }}" - http_method: patch - path: "{{ pool_path }}" - api_version: 16.4 - data: - add: - servers: - - ip: - addr: 10.10.10.10 - type: V4 - - ip: - addr: 20.20.20.20 - type: V4 - register: updated_pool - - - name: Fetch Pool metrics bandwidth and connections rate - community.network.avi_api_session: - controller: "{{ controller }}" - username: "{{ username }}" - password: "{{ password }}" - http_method: get - path: analytics/metrics/pool - api_version: 16.4 - params: - name: "{{ pool_name }}" - metric_id: l4_server.avg_bandwidth,l4_server.avg_complete_conns - step: 300 - limit: 10 - register: pool_metrics - -''' - - -RETURN = ''' -obj: - description: Avi REST resource - returned: success, changed - type: dict -''' - - -import json -import time -from ansible.module_utils.basic import AnsibleModule -from copy import deepcopy - -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, ansible_return, avi_obj_cmp, - cleanup_absent_fields, HAS_AVI) - from ansible_collections.community.network.plugins.module_utils.network.avi.avi_api import ( - ApiSession, AviCredentials) -except ImportError: - HAS_AVI = False - - -def main(): - argument_specs = dict( - http_method=dict(required=True, - choices=['get', 'put', 'post', 'patch', - 'delete']), - path=dict(type='str', required=True), - params=dict(type='dict'), - data=dict(type='jsonarg'), - timeout=dict(type='int', default=60) - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule(argument_spec=argument_specs) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - api_creds = AviCredentials() - api_creds.update_from_ansible_module(module) - api = ApiSession.get_session( - api_creds.controller, api_creds.username, password=api_creds.password, - timeout=api_creds.timeout, tenant=api_creds.tenant, - tenant_uuid=api_creds.tenant_uuid, token=api_creds.token, - port=api_creds.port) - - tenant_uuid = api_creds.tenant_uuid - tenant = api_creds.tenant - timeout = int(module.params.get('timeout')) - # path is a required argument - path = module.params.get('path', '') - params = module.params.get('params', None) - data = module.params.get('data', None) - # Get the api_version from module. - api_version = api_creds.api_version - if data is not None: - data = json.loads(data) - method = module.params['http_method'] - - existing_obj = None - changed = method != 'get' - gparams = deepcopy(params) if params else {} - gparams.update({'include_refs': '', 'include_name': ''}) - - # API methods not allowed - api_get_not_allowed = ["cluster", "gslbsiteops"] - api_post_not_allowed = ["alert", "fileservice"] - api_put_not_allowed = ["backup"] - - if method == 'post' and not any(path.startswith(uri) for uri in api_post_not_allowed): - # TODO: Above condition should be updated after AV-38981 is fixed - # need to check if object already exists. In that case - # change the method to be put - try: - using_collection = False - if not any(path.startswith(uri) for uri in api_get_not_allowed): - if 'name' in data: - gparams['name'] = data['name'] - using_collection = True - if not any(path.startswith(uri) for uri in api_get_not_allowed): - rsp = api.get(path, tenant=tenant, tenant_uuid=tenant_uuid, - params=gparams, api_version=api_version) - existing_obj = rsp.json() - if using_collection: - existing_obj = existing_obj['results'][0] - except (IndexError, KeyError): - # object is not found - pass - else: - if not any(path.startswith(uri) for uri in api_get_not_allowed): - # object is present - method = 'put' - path += '/' + existing_obj['uuid'] - - if method == 'put' and not any(path.startswith(uri) for uri in api_put_not_allowed): - # put can happen with when full path is specified or it is put + post - if existing_obj is None: - using_collection = False - if ((len(path.split('/')) == 1) and ('name' in data) and - (not any(path.startswith(uri) for uri in api_get_not_allowed))): - gparams['name'] = data['name'] - using_collection = True - rsp = api.get(path, tenant=tenant, tenant_uuid=tenant_uuid, - params=gparams, api_version=api_version) - rsp_data = rsp.json() - if using_collection: - if rsp_data['results']: - existing_obj = rsp_data['results'][0] - path += '/' + existing_obj['uuid'] - else: - method = 'post' - else: - if rsp.status_code == 404: - method = 'post' - else: - existing_obj = rsp_data - if existing_obj: - changed = not avi_obj_cmp(data, existing_obj) - cleanup_absent_fields(data) - if method == 'patch': - rsp = api.get(path, tenant=tenant, tenant_uuid=tenant_uuid, - params=gparams, api_version=api_version) - existing_obj = rsp.json() - - if (method == 'put' and changed) or (method != 'put'): - fn = getattr(api, method) - rsp = fn(path, tenant=tenant, tenant_uuid=tenant, timeout=timeout, - params=params, data=data, api_version=api_version) - else: - rsp = None - if method == 'delete' and rsp.status_code == 404: - changed = False - rsp.status_code = 200 - if method == 'patch' and existing_obj and rsp.status_code < 299: - # Ideally the comparison should happen with the return values - # from the patch API call. However, currently Avi API are - # returning different hostname when GET is used vs Patch. - # tracked as AV-12561 - if path.startswith('pool'): - time.sleep(1) - gparams = deepcopy(params) if params else {} - gparams.update({'include_refs': '', 'include_name': ''}) - rsp = api.get(path, tenant=tenant, tenant_uuid=tenant_uuid, - params=gparams, api_version=api_version) - new_obj = rsp.json() - changed = not avi_obj_cmp(new_obj, existing_obj) - if rsp is None: - return module.exit_json(changed=changed, obj=existing_obj) - return ansible_return(module, rsp, changed, req=data) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_api_version.py b/plugins/modules/network/avi/avi_api_version.py deleted file mode 100644 index 5b5ea5f3..00000000 --- a/plugins/modules/network/avi/avi_api_version.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/python -""" -# Created on July 24, 2017 -# -# @author: Vilian Atmadzhov (vilian.atmadzhov@paddypowerbetfair.com) GitHub ID: vivobg -# -# module_check: not supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# Vilian Atmadzhov, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# -""" - - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_api_version -author: Vilian Atmadzhov (@vivobg) - -short_description: Avi API Version Module -description: - - This module can be used to obtain the version of the Avi REST API. U(https://avinetworks.com/) -requirements: [ avisdk ] -options: {} -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = ''' - - name: Get AVI API version - community.network.avi_api_version: - controller: "" - username: "" - password: "" - tenant: "" - register: avi_controller_version -''' - - -RETURN = ''' -obj: - description: Avi REST resource - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule - -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, ansible_return, HAS_AVI) - from ansible_collections.community.network.plugins.module_utils.network.avi.avi_api import ( - ApiSession, AviCredentials) -except ImportError: - HAS_AVI = False - - -def main(): - argument_specs = dict() - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule(argument_spec=argument_specs) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - try: - api_creds = AviCredentials() - api_creds.update_from_ansible_module(module) - api = ApiSession.get_session( - api_creds.controller, api_creds.username, - password=api_creds.password, - timeout=api_creds.timeout, tenant=api_creds.tenant, - tenant_uuid=api_creds.tenant_uuid, token=api_creds.token, - port=api_creds.port) - - remote_api_version = api.remote_api_version - remote = {} - for key in remote_api_version.keys(): - remote[key.lower()] = remote_api_version[key] - api.close() - module.exit_json(changed=False, obj=remote) - except Exception as e: - module.fail_json(msg=("Unable to get an AVI session. %s" % e)) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_applicationpersistenceprofile.py b/plugins/modules/network/avi/avi_applicationpersistenceprofile.py deleted file mode 100644 index e43967d9..00000000 --- a/plugins/modules/network/avi/avi_applicationpersistenceprofile.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_applicationpersistenceprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ApplicationPersistenceProfile Avi RESTful Object -description: - - This module is used to configure ApplicationPersistenceProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - app_cookie_persistence_profile: - description: - - Specifies the application cookie persistence profile parameters. - description: - description: - - User defined description for the object. - hdr_persistence_profile: - description: - - Specifies the custom http header persistence profile parameters. - http_cookie_persistence_profile: - description: - - Specifies the http cookie persistence profile parameters. - ip_persistence_profile: - description: - - Specifies the client ip persistence profile parameters. - is_federated: - description: - - This field describes the object's replication scope. - - If the field is set to false, then the object is visible within the controller-cluster and its associated service-engines. - - If the field is set to true, then the object is replicated across the federation. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - name: - description: - - A user-friendly name for the persistence profile. - required: true - persistence_type: - description: - - Method used to persist clients to the same server for a duration of time or a session. - - Enum options - PERSISTENCE_TYPE_CLIENT_IP_ADDRESS, PERSISTENCE_TYPE_HTTP_COOKIE, PERSISTENCE_TYPE_TLS, PERSISTENCE_TYPE_CLIENT_IPV6_ADDRESS, - - PERSISTENCE_TYPE_CUSTOM_HTTP_HEADER, PERSISTENCE_TYPE_APP_COOKIE, PERSISTENCE_TYPE_GSLB_SITE. - - Default value when not specified in API or module is interpreted by Avi Controller as PERSISTENCE_TYPE_CLIENT_IP_ADDRESS. - required: true - server_hm_down_recovery: - description: - - Specifies behavior when a persistent server has been marked down by a health monitor. - - Enum options - HM_DOWN_PICK_NEW_SERVER, HM_DOWN_ABORT_CONNECTION, HM_DOWN_CONTINUE_PERSISTENT_SERVER. - - Default value when not specified in API or module is interpreted by Avi Controller as HM_DOWN_PICK_NEW_SERVER. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the persistence profile. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create an Application Persistence setting using http cookie. - community.network.avi_applicationpersistenceprofile: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - http_cookie_persistence_profile: - always_send_cookie: false - cookie_name: My-HTTP - key: - - aes_key: ShYGZdMks8j6Bpvm2sCvaXWzvXms2Z9ob+TTjRy46lQ= - name: c1276819-550c-4adf-912d-59efa5fd7269 - - aes_key: OGsyVk84VCtyMENFOW0rMnRXVnNrb0RzdG5mT29oamJRb0dlbHZVSjR1az0= - name: a080de57-77c3-4580-a3ea-e7a6493c14fd - - aes_key: UVN0cU9HWmFUM2xOUzBVcmVXaHFXbnBLVUUxMU1VSktSVU5HWjJOWmVFMTBUMUV4UmxsNk4xQmFZejA9 - name: 60478846-33c6-484d-868d-bbc324fce4a5 - timeout: 15 - name: My-HTTP-Cookie - persistence_type: PERSISTENCE_TYPE_HTTP_COOKIE - server_hm_down_recovery: HM_DOWN_PICK_NEW_SERVER - tenant_ref: Demo -""" - -RETURN = ''' -obj: - description: ApplicationPersistenceProfile (api/applicationpersistenceprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - app_cookie_persistence_profile=dict(type='dict',), - description=dict(type='str',), - hdr_persistence_profile=dict(type='dict',), - http_cookie_persistence_profile=dict(type='dict',), - ip_persistence_profile=dict(type='dict',), - is_federated=dict(type='bool',), - name=dict(type='str', required=True), - persistence_type=dict(type='str', required=True), - server_hm_down_recovery=dict(type='str',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'applicationpersistenceprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_applicationprofile.py b/plugins/modules/network/avi/avi_applicationprofile.py deleted file mode 100644 index 456c66a2..00000000 --- a/plugins/modules/network/avi/avi_applicationprofile.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_applicationprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ApplicationProfile Avi RESTful Object -description: - - This module is used to configure ApplicationProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cloud_config_cksum: - description: - - Checksum of application profiles. - - Internally set by cloud connector. - - Field introduced in 17.2.14, 18.1.5, 18.2.1. - created_by: - description: - - Name of the application profile creator. - - Field introduced in 17.2.14, 18.1.5, 18.2.1. - description: - description: - - User defined description for the object. - dns_service_profile: - description: - - Specifies various dns service related controls for virtual service. - dos_rl_profile: - description: - - Specifies various security related controls for virtual service. - http_profile: - description: - - Specifies the http application proxy profile parameters. - name: - description: - - The name of the application profile. - required: true - preserve_client_ip: - description: - - Specifies if client ip needs to be preserved for backend connection. - - Not compatible with connection multiplexing. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - preserve_client_port: - description: - - Specifies if we need to preserve client port while preserving client ip for backend connections. - - Field introduced in 17.2.7. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - sip_service_profile: - description: - - Specifies various sip service related controls for virtual service. - - Field introduced in 17.2.8, 18.1.3, 18.2.1. - tcp_app_profile: - description: - - Specifies the tcp application proxy profile parameters. - tenant_ref: - description: - - It is a reference to an object of type tenant. - type: - description: - - Specifies which application layer proxy is enabled for the virtual service. - - Enum options - APPLICATION_PROFILE_TYPE_L4, APPLICATION_PROFILE_TYPE_HTTP, APPLICATION_PROFILE_TYPE_SYSLOG, APPLICATION_PROFILE_TYPE_DNS, - - APPLICATION_PROFILE_TYPE_SSL, APPLICATION_PROFILE_TYPE_SIP. - required: true - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the application profile. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create an Application Profile for HTTP application enabled for SSL traffic - community.network.avi_applicationprofile: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - http_profile: - cache_config: - age_header: true - aggressive: false - date_header: true - default_expire: 600 - enabled: false - heuristic_expire: false - max_cache_size: 0 - max_object_size: 4194304 - mime_types_group_refs: - - admin:System-Cacheable-Resource-Types - min_object_size: 100 - query_cacheable: false - xcache_header: true - client_body_timeout: 0 - client_header_timeout: 10000 - client_max_body_size: 0 - client_max_header_size: 12 - client_max_request_size: 48 - compression_profile: - compressible_content_ref: admin:System-Compressible-Content-Types - compression: false - remove_accept_encoding_header: true - type: AUTO_COMPRESSION - connection_multiplexing_enabled: true - hsts_enabled: false - hsts_max_age: 365 - http_to_https: false - httponly_enabled: false - keepalive_header: false - keepalive_timeout: 30000 - max_bad_rps_cip: 0 - max_bad_rps_cip_uri: 0 - max_bad_rps_uri: 0 - max_rps_cip: 0 - max_rps_cip_uri: 0 - max_rps_unknown_cip: 0 - max_rps_unknown_uri: 0 - max_rps_uri: 0 - post_accept_timeout: 30000 - secure_cookie_enabled: false - server_side_redirect_to_https: false - spdy_enabled: false - spdy_fwd_proxy_mode: false - ssl_client_certificate_mode: SSL_CLIENT_CERTIFICATE_NONE - ssl_everywhere_enabled: false - websockets_enabled: true - x_forwarded_proto_enabled: false - xff_alternate_name: X-Forwarded-For - xff_enabled: true - name: System-HTTP - tenant_ref: admin - type: APPLICATION_PROFILE_TYPE_HTTP -""" - -RETURN = ''' -obj: - description: ApplicationProfile (api/applicationprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cloud_config_cksum=dict(type='str',), - created_by=dict(type='str',), - description=dict(type='str',), - dns_service_profile=dict(type='dict',), - dos_rl_profile=dict(type='dict',), - http_profile=dict(type='dict',), - name=dict(type='str', required=True), - preserve_client_ip=dict(type='bool',), - preserve_client_port=dict(type='bool',), - sip_service_profile=dict(type='dict',), - tcp_app_profile=dict(type='dict',), - tenant_ref=dict(type='str',), - type=dict(type='str', required=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'applicationprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_authprofile.py b/plugins/modules/network/avi/avi_authprofile.py deleted file mode 100644 index 88667db1..00000000 --- a/plugins/modules/network/avi/avi_authprofile.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_authprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of AuthProfile Avi RESTful Object -description: - - This module is used to configure AuthProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - description: - description: - - User defined description for the object. - http: - description: - - Http user authentication params. - ldap: - description: - - Ldap server and directory settings. - name: - description: - - Name of the auth profile. - required: true - pa_agent_ref: - description: - - Pingaccessagent uuid. - - It is a reference to an object of type pingaccessagent. - - Field introduced in 18.2.3. - saml: - description: - - Saml settings. - - Field introduced in 17.2.3. - tacacs_plus: - description: - - Tacacs+ settings. - tenant_ref: - description: - - It is a reference to an object of type tenant. - type: - description: - - Type of the auth profile. - - Enum options - AUTH_PROFILE_LDAP, AUTH_PROFILE_TACACS_PLUS, AUTH_PROFILE_SAML, AUTH_PROFILE_PINGACCESS. - required: true - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the auth profile. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create user authorization profile based on the LDAP - community.network.avi_authprofile: - controller: '{{ controller }}' - password: '{{ password }}' - username: '{{ username }}' - http: - cache_expiration_time: 5 - group_member_is_full_dn: false - ldap: - base_dn: dc=avi,dc=local - bind_as_administrator: true - port: 389 - security_mode: AUTH_LDAP_SECURE_NONE - server: - - 10.10.0.100 - settings: - admin_bind_dn: user@avi.local - group_filter: (objectClass=*) - group_member_attribute: member - group_member_is_full_dn: true - group_search_dn: dc=avi,dc=local - group_search_scope: AUTH_LDAP_SCOPE_SUBTREE - ignore_referrals: true - password: password - user_id_attribute: samAccountname - user_search_dn: dc=avi,dc=local - user_search_scope: AUTH_LDAP_SCOPE_ONE - name: ProdAuth - tenant_ref: admin - type: AUTH_PROFILE_LDAP -""" - -RETURN = ''' -obj: - description: AuthProfile (api/authprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - description=dict(type='str',), - http=dict(type='dict',), - ldap=dict(type='dict',), - name=dict(type='str', required=True), - pa_agent_ref=dict(type='str',), - saml=dict(type='dict',), - tacacs_plus=dict(type='dict',), - tenant_ref=dict(type='str',), - type=dict(type='str', required=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'authprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_autoscalelaunchconfig.py b/plugins/modules/network/avi/avi_autoscalelaunchconfig.py deleted file mode 100644 index 39e93f83..00000000 --- a/plugins/modules/network/avi/avi_autoscalelaunchconfig.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_autoscalelaunchconfig -author: Chaitanya Deshpande (@chaitanyaavi) - -short_description: Module for setup of AutoScaleLaunchConfig Avi RESTful Object -description: - - This module is used to configure AutoScaleLaunchConfig object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - description: - description: - - User defined description for the object. - image_id: - description: - - Unique id of the amazon machine image (ami) or openstack vm id. - mesos: - description: - - Autoscalemesossettings settings for autoscalelaunchconfig. - name: - description: - - Name of the object. - required: true - openstack: - description: - - Autoscaleopenstacksettings settings for autoscalelaunchconfig. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - use_external_asg: - description: - - If set to true, serverautoscalepolicy will use the autoscaling group (external_autoscaling_groups) from pool to perform scale up and scale down. - - Pool should have single autoscaling group configured. - - Field introduced in 17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create an Autoscale Launch configuration. - community.network.avi_autoscalelaunchconfig: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - image_id: default - name: default-autoscalelaunchconfig - tenant_ref: admin -""" - -RETURN = ''' -obj: - description: AutoScaleLaunchConfig (api/autoscalelaunchconfig) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - description=dict(type='str',), - image_id=dict(type='str',), - mesos=dict(type='dict',), - name=dict(type='str', required=True), - openstack=dict(type='dict',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - use_external_asg=dict(type='bool',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'autoscalelaunchconfig', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_backup.py b/plugins/modules/network/avi/avi_backup.py deleted file mode 100644 index f052d0a4..00000000 --- a/plugins/modules/network/avi/avi_backup.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_backup -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Backup Avi RESTful Object -description: - - This module is used to configure Backup object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - backup_config_ref: - description: - - Backupconfiguration information. - - It is a reference to an object of type backupconfiguration. - file_name: - description: - - The file name of backup. - required: true - local_file_url: - description: - - Url to download the backup file. - remote_file_url: - description: - - Url to download the backup file. - scheduler_ref: - description: - - Scheduler information. - - It is a reference to an object of type scheduler. - tenant_ref: - description: - - It is a reference to an object of type tenant. - timestamp: - description: - - Unix timestamp of when the backup file is created. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create Backup object - community.network.avi_backup: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_backup -""" - -RETURN = ''' -obj: - description: Backup (api/backup) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - backup_config_ref=dict(type='str',), - file_name=dict(type='str', required=True), - local_file_url=dict(type='str',), - remote_file_url=dict(type='str',), - scheduler_ref=dict(type='str',), - tenant_ref=dict(type='str',), - timestamp=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'backup', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_backupconfiguration.py b/plugins/modules/network/avi/avi_backupconfiguration.py deleted file mode 100644 index 7ba546a0..00000000 --- a/plugins/modules/network/avi/avi_backupconfiguration.py +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_backupconfiguration -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of BackupConfiguration Avi RESTful Object -description: - - This module is used to configure BackupConfiguration object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - aws_access_key: - description: - - Aws access key id. - - Field introduced in 18.2.3. - aws_bucket_id: - description: - - Aws bucket. - - Field introduced in 18.2.3. - aws_secret_access: - description: - - Aws secret access key. - - Field introduced in 18.2.3. - backup_file_prefix: - description: - - Prefix of the exported configuration file. - - Field introduced in 17.1.1. - backup_passphrase: - description: - - Passphrase of backup configuration. - maximum_backups_stored: - description: - - Rotate the backup files based on this count. - - Allowed values are 1-20. - - Default value when not specified in API or module is interpreted by Avi Controller as 4. - name: - description: - - Name of backup configuration. - required: true - remote_directory: - description: - - Directory at remote destination with write permission for ssh user. - remote_hostname: - description: - - Remote destination. - save_local: - description: - - Local backup. - type: bool - ssh_user_ref: - description: - - Access credentials for remote destination. - - It is a reference to an object of type cloudconnectoruser. - tenant_ref: - description: - - It is a reference to an object of type tenant. - upload_to_remote_host: - description: - - Remote backup. - type: bool - upload_to_s3: - description: - - Cloud backup. - - Field introduced in 18.2.3. - type: bool - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create BackupConfiguration object - community.network.avi_backupconfiguration: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_backupconfiguration -""" - -RETURN = ''' -obj: - description: BackupConfiguration (api/backupconfiguration) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - aws_access_key=dict(type='str', no_log=True,), - aws_bucket_id=dict(type='str',), - aws_secret_access=dict(type='str', no_log=True,), - backup_file_prefix=dict(type='str',), - backup_passphrase=dict(type='str', no_log=True,), - maximum_backups_stored=dict(type='int',), - name=dict(type='str', required=True), - remote_directory=dict(type='str',), - remote_hostname=dict(type='str',), - save_local=dict(type='bool',), - ssh_user_ref=dict(type='str',), - tenant_ref=dict(type='str',), - upload_to_remote_host=dict(type='bool',), - upload_to_s3=dict(type='bool',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'backupconfiguration', - set(['backup_passphrase', 'aws_access_key', 'aws_secret_access'])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_certificatemanagementprofile.py b/plugins/modules/network/avi/avi_certificatemanagementprofile.py deleted file mode 100644 index aaac46e7..00000000 --- a/plugins/modules/network/avi/avi_certificatemanagementprofile.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_certificatemanagementprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of CertificateManagementProfile Avi RESTful Object -description: - - This module is used to configure CertificateManagementProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - name: - description: - - Name of the pki profile. - required: true - script_params: - description: - - List of customparams. - script_path: - description: - - Script_path of certificatemanagementprofile. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create CertificateManagementProfile object - community.network.avi_certificatemanagementprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_certificatemanagementprofile -""" - -RETURN = ''' -obj: - description: CertificateManagementProfile (api/certificatemanagementprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - name=dict(type='str', required=True), - script_params=dict(type='list',), - script_path=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'certificatemanagementprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_cloud.py b/plugins/modules/network/avi/avi_cloud.py deleted file mode 100644 index 568d68ca..00000000 --- a/plugins/modules/network/avi/avi_cloud.py +++ /dev/null @@ -1,287 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_cloud -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Cloud Avi RESTful Object -description: - - This module is used to configure Cloud object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - apic_configuration: - description: - - Apicconfiguration settings for cloud. - apic_mode: - description: - - Boolean flag to set apic_mode. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - autoscale_polling_interval: - description: - - Cloudconnector polling interval for external autoscale groups. - - Field introduced in 18.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - aws_configuration: - description: - - Awsconfiguration settings for cloud. - azure_configuration: - description: - - Field introduced in 17.2.1. - 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. - dhcp_enabled: - description: - - Select the ip address management scheme. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - dns_provider_ref: - description: - - Dns profile for the cloud. - - It is a reference to an object of type ipamdnsproviderprofile. - docker_configuration: - description: - - Dockerconfiguration settings for cloud. - east_west_dns_provider_ref: - description: - - Dns profile for east-west services. - - It is a reference to an object of type ipamdnsproviderprofile. - east_west_ipam_provider_ref: - description: - - Ipam profile for east-west services. - - Warning - please use virtual subnets in this ipam profile that do not conflict with the underlay networks or any overlay networks in the cluster. - - For example in aws and gcp, 169.254.0.0/16 is used for storing instance metadata. - - Hence, it should not be used in this profile. - - It is a reference to an object of type ipamdnsproviderprofile. - enable_vip_static_routes: - description: - - Use static routes for vip side network resolution during virtualservice placement. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - gcp_configuration: - description: - - Google cloud platform configuration. - - Field introduced in 18.2.1. - ip6_autocfg_enabled: - description: - - Enable ipv6 auto configuration. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - ipam_provider_ref: - 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. - 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, LIC_SE_BANDWIDTH, LIC_METERED_SE_BANDWIDTH. - linuxserver_configuration: - description: - - Linuxserverconfiguration settings for cloud. - mesos_configuration: - description: - - Field deprecated in 18.2.2. - mtu: - description: - - Mtu setting for the cloud. - - Default value when not specified in API or module is interpreted by Avi Controller as 1500. - name: - description: - - Name of the object. - required: true - nsx_configuration: - description: - - Configuration parameters for nsx manager. - - Field introduced in 17.1.1. - obj_name_prefix: - description: - - Default prefix for all automatically created objects in this cloud. - - This prefix can be overridden by the se-group template. - openstack_configuration: - description: - - Openstackconfiguration settings for cloud. - oshiftk8s_configuration: - description: - - Oshiftk8sconfiguration settings for cloud. - prefer_static_routes: - description: - - Prefer static routes over interface routes during virtualservice placement. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - proxy_configuration: - description: - - Proxyconfiguration settings for cloud. - 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. - type: bool - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. - vca_configuration: - description: - - Vcloudairconfiguration settings for cloud. - vcenter_configuration: - description: - - Vcenterconfiguration settings for cloud. - vtype: - 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_AZURE, CLOUD_GCP. - - Default value when not specified in API or module is interpreted by Avi Controller as CLOUD_NONE. - required: true -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create a VMware cloud with write access mode - community.network.avi_cloud: - username: '{{ username }}' - controller: '{{ controller }}' - password: '{{ password }}' - apic_mode: false - dhcp_enabled: true - enable_vip_static_routes: false - license_type: LIC_CORES - mtu: 1500 - name: vCenter Cloud - prefer_static_routes: false - tenant_ref: admin - vcenter_configuration: - datacenter_ref: /api/vimgrdcruntime/datacenter-2-10.10.20.100 - management_network: /api/vimgrnwruntime/dvportgroup-103-10.10.20.100 - password: password - privilege: WRITE_ACCESS - username: user - vcenter_url: 10.10.20.100 - vtype: CLOUD_VCENTER -""" - -RETURN = ''' -obj: - description: Cloud (api/cloud) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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',), - autoscale_polling_interval=dict(type='int',), - 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',), - east_west_dns_provider_ref=dict(type='str',), - east_west_ipam_provider_ref=dict(type='str',), - enable_vip_static_routes=dict(type='bool',), - gcp_configuration=dict(type='dict',), - ip6_autocfg_enabled=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',), - mtu=dict(type='int',), - name=dict(type='str', required=True), - nsx_configuration=dict(type='dict',), - obj_name_prefix=dict(type='str',), - openstack_configuration=dict(type='dict',), - oshiftk8s_configuration=dict(type='dict',), - 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',), - vca_configuration=dict(type='dict',), - vcenter_configuration=dict(type='dict',), - vtype=dict(type='str', required=True), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'cloud', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_cloudconnectoruser.py b/plugins/modules/network/avi/avi_cloudconnectoruser.py deleted file mode 100644 index f426f756..00000000 --- a/plugins/modules/network/avi/avi_cloudconnectoruser.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_cloudconnectoruser -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of CloudConnectorUser Avi RESTful Object -description: - - This module is used to configure CloudConnectorUser object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - azure_serviceprincipal: - description: - - Field introduced in 17.2.1. - azure_userpass: - description: - - Field introduced in 17.2.1. - gcp_credentials: - description: - - Credentials for google cloud platform. - - Field introduced in 18.2.1. - name: - description: - - Name of the object. - required: true - oci_credentials: - description: - - Credentials for oracle cloud infrastructure. - - Field introduced in 18.2.1,18.1.3. - private_key: - description: - - Private_key of cloudconnectoruser. - public_key: - description: - - Public_key of cloudconnectoruser. - tenant_ref: - description: - - It is a reference to an object of type tenant. - tencent_credentials: - description: - - Credentials for tencent cloud. - - Field introduced in 18.2.3. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create a Cloud connector user that is used for integration into cloud platforms - community.network.avi_cloudconnectoruser: - controller: '{{ controller }}' - name: root - password: '{{ password }}' - private_key: | - -----BEGIN RSA PRIVATE KEY----- - -----END RSA PRIVATE KEY-----' - public_key: 'ssh-rsa ...' - tenant_ref: admin - username: '{{ username }}' -""" - -RETURN = ''' -obj: - description: CloudConnectorUser (api/cloudconnectoruser) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - azure_serviceprincipal=dict(type='dict',), - azure_userpass=dict(type='dict', no_log=True), - gcp_credentials=dict(type='dict', no_log=True), - name=dict(type='str', required=True), - oci_credentials=dict(type='dict', no_log=True), - private_key=dict(type='str', no_log=True,), - public_key=dict(type='str',), - tenant_ref=dict(type='str',), - tencent_credentials=dict(type='dict', no_log=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'cloudconnectoruser', - set(['private_key'])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_cloudproperties.py b/plugins/modules/network/avi/avi_cloudproperties.py deleted file mode 100644 index d054a9c5..00000000 --- a/plugins/modules/network/avi/avi_cloudproperties.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_cloudproperties -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of CloudProperties Avi RESTful Object -description: - - This module is used to configure CloudProperties object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cc_props: - description: - - Cloudconnector properties. - cc_vtypes: - description: - - Cloud types supported by cloudconnector. - - 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_AZURE, CLOUD_GCP. - hyp_props: - description: - - Hypervisor properties. - info: - description: - - Properties specific to a cloud type. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create CloudProperties object - community.network.avi_cloudproperties: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_cloudproperties -""" - -RETURN = ''' -obj: - description: CloudProperties (api/cloudproperties) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cc_props=dict(type='dict',), - cc_vtypes=dict(type='list',), - hyp_props=dict(type='list',), - info=dict(type='list',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'cloudproperties', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_cluster.py b/plugins/modules/network/avi/avi_cluster.py deleted file mode 100644 index e31feae3..00000000 --- a/plugins/modules/network/avi/avi_cluster.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_cluster -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Cluster Avi RESTful Object -description: - - This module is used to configure Cluster object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - name: - description: - - Name of the object. - required: true - nodes: - description: - - List of clusternode. - rejoin_nodes_automatically: - description: - - Re-join cluster nodes automatically in the event one of the node is reset to factory. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. - virtual_ip: - description: - - A virtual ip address. - - This ip address will be dynamically reconfigured so that it always is the ip of the cluster leader. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create Cluster object - community.network.avi_cluster: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_cluster -""" - -RETURN = ''' -obj: - description: Cluster (api/cluster) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - name=dict(type='str', required=True), - nodes=dict(type='list',), - rejoin_nodes_automatically=dict(type='bool',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - virtual_ip=dict(type='dict',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'cluster', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_clusterclouddetails.py b/plugins/modules/network/avi/avi_clusterclouddetails.py deleted file mode 100644 index 938f3515..00000000 --- a/plugins/modules/network/avi/avi_clusterclouddetails.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_clusterclouddetails -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ClusterCloudDetails Avi RESTful Object -description: - - This module is used to configure ClusterCloudDetails object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - azure_info: - description: - - Azure info to configure cluster_vip on the controller. - - Field introduced in 17.2.5. - name: - description: - - Field introduced in 17.2.5. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.2.5. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Field introduced in 17.2.5. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ClusterCloudDetails object - community.network.avi_clusterclouddetails: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_clusterclouddetails -""" - -RETURN = ''' -obj: - description: ClusterCloudDetails (api/clusterclouddetails) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - azure_info=dict(type='dict',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'clusterclouddetails', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_controllerproperties.py b/plugins/modules/network/avi/avi_controllerproperties.py deleted file mode 100644 index 4b68d379..00000000 --- a/plugins/modules/network/avi/avi_controllerproperties.py +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.2 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_controllerproperties -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ControllerProperties Avi RESTful Object -description: - - This module is used to configure ControllerProperties object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - allow_ip_forwarding: - description: - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - allow_unauthenticated_apis: - description: - - Allow unauthenticated access for special apis. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - allow_unauthenticated_nodes: - description: - - Boolean flag to set allow_unauthenticated_nodes. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - api_idle_timeout: - description: - - Allowed values are 0-1440. - - Default value when not specified in API or module is interpreted by Avi Controller as 15. - api_perf_logging_threshold: - description: - - Threshold to log request timing in portal_performance.log and server-timing response header. - - Any stage taking longer than 1% of the threshold will be included in the server-timing header. - - Field introduced in 18.1.4, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 10000. - appviewx_compat_mode: - description: - - Export configuration in appviewx compatibility mode. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - attach_ip_retry_interval: - description: - - Number of attach_ip_retry_interval. - - Default value when not specified in API or module is interpreted by Avi Controller as 360. - attach_ip_retry_limit: - description: - - Number of attach_ip_retry_limit. - - Default value when not specified in API or module is interpreted by Avi Controller as 4. - bm_use_ansible: - description: - - Use ansible for se creation in baremetal. - - Field introduced in 17.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - cleanup_expired_authtoken_timeout_period: - description: - - Period for auth token cleanup job. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - cleanup_sessions_timeout_period: - description: - - Period for sessions cleanup job. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - cloud_reconcile: - description: - - Enable/disable periodic reconcile for all the clouds. - - Field introduced in 17.2.14,18.1.5,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - cluster_ip_gratuitous_arp_period: - description: - - Period for cluster ip gratuitous arp job. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - consistency_check_timeout_period: - description: - - Period for consistency check job. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - crashed_se_reboot: - description: - - Number of crashed_se_reboot. - - Default value when not specified in API or module is interpreted by Avi Controller as 900. - dead_se_detection_timer: - description: - - Number of dead_se_detection_timer. - - Default value when not specified in API or module is interpreted by Avi Controller as 360. - dns_refresh_period: - description: - - Period for refresh pool and gslb dns job. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - dummy: - description: - - Number of dummy. - enable_api_sharding: - description: - - This setting enables the controller leader to shard api requests to the followers (if any). - - Field introduced in 18.1.5, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - enable_memory_balancer: - description: - - Enable/disable memory balancer. - - Field introduced in 17.2.8. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - fatal_error_lease_time: - description: - - Number of fatal_error_lease_time. - - Default value when not specified in API or module is interpreted by Avi Controller as 120. - max_dead_se_in_grp: - description: - - Number of max_dead_se_in_grp. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - max_pcap_per_tenant: - description: - - Maximum number of pcap files stored per tenant. - - Default value when not specified in API or module is interpreted by Avi Controller as 4. - max_seq_attach_ip_failures: - description: - - Maximum number of consecutive attach ip failures that halts vs placement. - - Field introduced in 17.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 3. - max_seq_vnic_failures: - description: - - Number of max_seq_vnic_failures. - - Default value when not specified in API or module is interpreted by Avi Controller as 3. - persistence_key_rotate_period: - description: - - Period for rotate app persistence keys job. - - Allowed values are 1-1051200. - - Special values are 0 - 'disabled'. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - portal_token: - description: - - Token used for uploading tech-support to portal. - - Field introduced in 16.4.6,17.1.2. - process_locked_useraccounts_timeout_period: - description: - - Period for process locked user accounts job. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - process_pki_profile_timeout_period: - description: - - Period for process pki profile job. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 1440. - query_host_fail: - description: - - Number of query_host_fail. - - Default value when not specified in API or module is interpreted by Avi Controller as 180. - safenet_hsm_version: - description: - - Version of the safenet package installed on the controller. - - Field introduced in 16.5.2,17.2.3. - se_create_timeout: - description: - - Number of se_create_timeout. - - Default value when not specified in API or module is interpreted by Avi Controller as 900. - se_failover_attempt_interval: - description: - - Interval between attempting failovers to an se. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - se_from_marketplace: - description: - - This setting decides whether se is to be deployed from the cloud marketplace or to be created by the controller. - - The setting is applicable only when byol license is selected. - - Enum options - MARKETPLACE, IMAGE. - - Field introduced in 18.1.4, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as IMAGE. - se_offline_del: - description: - - Number of se_offline_del. - - Default value when not specified in API or module is interpreted by Avi Controller as 172000. - se_vnic_cooldown: - description: - - Number of se_vnic_cooldown. - - Default value when not specified in API or module is interpreted by Avi Controller as 120. - secure_channel_cleanup_timeout: - description: - - Period for secure channel cleanup job. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - secure_channel_controller_token_timeout: - description: - - Number of secure_channel_controller_token_timeout. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - secure_channel_se_token_timeout: - description: - - Number of secure_channel_se_token_timeout. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - seupgrade_fabric_pool_size: - description: - - Pool size used for all fabric commands during se upgrade. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - seupgrade_segroup_min_dead_timeout: - description: - - Time to wait before marking segroup upgrade as stuck. - - Default value when not specified in API or module is interpreted by Avi Controller as 360. - ssl_certificate_expiry_warning_days: - description: - - Number of days for ssl certificate expiry warning. - unresponsive_se_reboot: - description: - - Number of unresponsive_se_reboot. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - upgrade_dns_ttl: - description: - - Time to account for dns ttl during upgrade. - - This is in addition to vs_scalein_timeout_for_upgrade in se_group. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 5. - upgrade_lease_time: - description: - - Number of upgrade_lease_time. - - Default value when not specified in API or module is interpreted by Avi Controller as 360. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. - vnic_op_fail_time: - description: - - Number of vnic_op_fail_time. - - Default value when not specified in API or module is interpreted by Avi Controller as 180. - vs_apic_scaleout_timeout: - description: - - Time to wait for the scaled out se to become ready before marking the scaleout done, applies to apic configuration only. - - Default value when not specified in API or module is interpreted by Avi Controller as 360. - vs_awaiting_se_timeout: - description: - - Number of vs_awaiting_se_timeout. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - vs_key_rotate_period: - description: - - Period for rotate vs keys job. - - Allowed values are 1-1051200. - - Special values are 0 - 'disabled'. - - Default value when not specified in API or module is interpreted by Avi Controller as 360. - vs_scaleout_ready_check_interval: - description: - - Interval for checking scaleout_ready status while controller is waiting for scaleoutready rpc from the service engine. - - Field introduced in 18.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - vs_se_attach_ip_fail: - description: - - Time to wait before marking attach ip operation on an se as failed. - - Field introduced in 17.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 600. - vs_se_bootup_fail: - description: - - Number of vs_se_bootup_fail. - - Default value when not specified in API or module is interpreted by Avi Controller as 480. - vs_se_create_fail: - description: - - Number of vs_se_create_fail. - - Default value when not specified in API or module is interpreted by Avi Controller as 1500. - vs_se_ping_fail: - description: - - Number of vs_se_ping_fail. - - Default value when not specified in API or module is interpreted by Avi Controller as 60. - vs_se_vnic_fail: - description: - - Number of vs_se_vnic_fail. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - vs_se_vnic_ip_fail: - description: - - Number of vs_se_vnic_ip_fail. - - Default value when not specified in API or module is interpreted by Avi Controller as 120. - warmstart_se_reconnect_wait_time: - description: - - Number of warmstart_se_reconnect_wait_time. - - Default value when not specified in API or module is interpreted by Avi Controller as 480. - warmstart_vs_resync_wait_time: - description: - - Timeout for warmstart vs resync. - - Field introduced in 18.1.4, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ControllerProperties object - community.network.avi_controllerproperties: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_controllerproperties -""" - -RETURN = ''' -obj: - description: ControllerProperties (api/controllerproperties) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - allow_ip_forwarding=dict(type='bool',), - allow_unauthenticated_apis=dict(type='bool',), - allow_unauthenticated_nodes=dict(type='bool',), - api_idle_timeout=dict(type='int',), - api_perf_logging_threshold=dict(type='int',), - appviewx_compat_mode=dict(type='bool',), - attach_ip_retry_interval=dict(type='int',), - attach_ip_retry_limit=dict(type='int',), - bm_use_ansible=dict(type='bool',), - cleanup_expired_authtoken_timeout_period=dict(type='int',), - cleanup_sessions_timeout_period=dict(type='int',), - cloud_reconcile=dict(type='bool',), - cluster_ip_gratuitous_arp_period=dict(type='int',), - consistency_check_timeout_period=dict(type='int',), - crashed_se_reboot=dict(type='int',), - dead_se_detection_timer=dict(type='int',), - dns_refresh_period=dict(type='int',), - dummy=dict(type='int',), - enable_api_sharding=dict(type='bool',), - enable_memory_balancer=dict(type='bool',), - fatal_error_lease_time=dict(type='int',), - max_dead_se_in_grp=dict(type='int',), - max_pcap_per_tenant=dict(type='int',), - max_seq_attach_ip_failures=dict(type='int',), - max_seq_vnic_failures=dict(type='int',), - persistence_key_rotate_period=dict(type='int',), - portal_token=dict(type='str', no_log=True,), - process_locked_useraccounts_timeout_period=dict(type='int',), - process_pki_profile_timeout_period=dict(type='int',), - query_host_fail=dict(type='int',), - safenet_hsm_version=dict(type='str',), - se_create_timeout=dict(type='int',), - se_failover_attempt_interval=dict(type='int',), - se_from_marketplace=dict(type='str',), - se_offline_del=dict(type='int',), - se_vnic_cooldown=dict(type='int',), - secure_channel_cleanup_timeout=dict(type='int',), - secure_channel_controller_token_timeout=dict(type='int',), - secure_channel_se_token_timeout=dict(type='int',), - seupgrade_fabric_pool_size=dict(type='int',), - seupgrade_segroup_min_dead_timeout=dict(type='int',), - ssl_certificate_expiry_warning_days=dict(type='list',), - unresponsive_se_reboot=dict(type='int',), - upgrade_dns_ttl=dict(type='int',), - upgrade_lease_time=dict(type='int',), - url=dict(type='str',), - uuid=dict(type='str',), - vnic_op_fail_time=dict(type='int',), - vs_apic_scaleout_timeout=dict(type='int',), - vs_awaiting_se_timeout=dict(type='int',), - vs_key_rotate_period=dict(type='int',), - vs_scaleout_ready_check_interval=dict(type='int',), - vs_se_attach_ip_fail=dict(type='int',), - vs_se_bootup_fail=dict(type='int',), - vs_se_create_fail=dict(type='int',), - vs_se_ping_fail=dict(type='int',), - vs_se_vnic_fail=dict(type='int',), - vs_se_vnic_ip_fail=dict(type='int',), - warmstart_se_reconnect_wait_time=dict(type='int',), - warmstart_vs_resync_wait_time=dict(type='int',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'controllerproperties', - set(['portal_token'])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_customipamdnsprofile.py b/plugins/modules/network/avi/avi_customipamdnsprofile.py deleted file mode 100644 index 074bda7b..00000000 --- a/plugins/modules/network/avi/avi_customipamdnsprofile.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_customipamdnsprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of CustomIpamDnsProfile Avi RESTful Object -description: - - This module is used to configure CustomIpamDnsProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - name: - description: - - Name of the custom ipam dns profile. - - Field introduced in 17.1.1. - required: true - script_params: - description: - - Parameters that are always passed to the ipam/dns script. - - Field introduced in 17.1.1. - script_uri: - description: - - Script uri of form controller //ipamdnsscripts/. - - Field introduced in 17.1.1. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.1.1. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Field introduced in 17.1.1. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create CustomIpamDnsProfile object - community.network.avi_customipamdnsprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_customipamdnsprofile -""" - -RETURN = ''' -obj: - description: CustomIpamDnsProfile (api/customipamdnsprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - name=dict(type='str', required=True), - script_params=dict(type='list',), - script_uri=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'customipamdnsprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_dnspolicy.py b/plugins/modules/network/avi/avi_dnspolicy.py deleted file mode 100644 index be23d5ef..00000000 --- a/plugins/modules/network/avi/avi_dnspolicy.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_dnspolicy -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of DnsPolicy Avi RESTful Object -description: - - This module is used to configure DnsPolicy object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - created_by: - description: - - Creator name. - - Field introduced in 17.1.1. - description: - description: - - Field introduced in 17.1.1. - name: - description: - - Name of the dns policy. - - Field introduced in 17.1.1. - required: true - rule: - description: - - Dns rules. - - Field introduced in 17.1.1. - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.1.1. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the dns policy. - - Field introduced in 17.1.1. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create DnsPolicy object - community.network.avi_dnspolicy: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_dnspolicy -""" - -RETURN = ''' -obj: - description: DnsPolicy (api/dnspolicy) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - created_by=dict(type='str',), - description=dict(type='str',), - name=dict(type='str', required=True), - rule=dict(type='list',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'dnspolicy', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_errorpagebody.py b/plugins/modules/network/avi/avi_errorpagebody.py deleted file mode 100644 index 709835a9..00000000 --- a/plugins/modules/network/avi/avi_errorpagebody.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_errorpagebody -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ErrorPageBody Avi RESTful Object -description: - - This module is used to configure ErrorPageBody object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - error_page_body: - description: - - Error page body sent to client when match. - - Field introduced in 17.2.4. - format: - description: - - Format of an error page body html or json. - - Enum options - ERROR_PAGE_FORMAT_HTML, ERROR_PAGE_FORMAT_JSON. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as ERROR_PAGE_FORMAT_HTML. - name: - description: - - Field introduced in 17.2.4. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.2.4. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Field introduced in 17.2.4. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ErrorPageBody object - community.network.avi_errorpagebody: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_errorpagebody -""" - -RETURN = ''' -obj: - description: ErrorPageBody (api/errorpagebody) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - error_page_body=dict(type='str',), - format=dict(type='str',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'errorpagebody', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_errorpageprofile.py b/plugins/modules/network/avi/avi_errorpageprofile.py deleted file mode 100644 index e594d15f..00000000 --- a/plugins/modules/network/avi/avi_errorpageprofile.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_errorpageprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ErrorPageProfile Avi RESTful Object -description: - - This module is used to configure ErrorPageProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - app_name: - description: - - Name of the virtual service which generated the error page. - - Field deprecated in 18.1.1. - - Field introduced in 17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as VS Name. - company_name: - description: - - Name of the company to show in error page. - - Field deprecated in 18.1.1. - - Field introduced in 17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as Avi Networks. - error_pages: - description: - - Defined error pages for http status codes. - - Field introduced in 17.2.4. - host_name: - description: - - Fully qualified domain name for which the error page is generated. - - Field deprecated in 18.1.1. - - Field introduced in 17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as Host Header. - name: - description: - - Field introduced in 17.2.4. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.2.4. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Field introduced in 17.2.4. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ErrorPageProfile object - community.network.avi_errorpageprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_errorpageprofile -""" - -RETURN = ''' -obj: - description: ErrorPageProfile (api/errorpageprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - app_name=dict(type='str',), - company_name=dict(type='str',), - error_pages=dict(type='list',), - host_name=dict(type='str',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'errorpageprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_gslb.py b/plugins/modules/network/avi/avi_gslb.py deleted file mode 100644 index ac6de5a1..00000000 --- a/plugins/modules/network/avi/avi_gslb.py +++ /dev/null @@ -1,353 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_gslb -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Gslb Avi RESTful Object -description: - - This module is used to configure Gslb object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - async_interval: - description: - - Frequency with which messages are propagated to vs mgr. - - Value of 0 disables async behavior and rpc are sent inline. - - Allowed values are 0-5. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - clear_on_max_retries: - description: - - Max retries after which the remote site is treated as a fresh start. - - In fresh start all the configs are downloaded. - - Allowed values are 1-1024. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - client_ip_addr_group: - description: - - Group to specify if the client ip addresses are public or private. - - Field introduced in 17.1.2. - description: - description: - - User defined description for the object. - dns_configs: - description: - - Sub domain configuration for the gslb. - - Gslb service's fqdn must be a match one of these subdomains. - is_federated: - description: - - This field indicates that this object is replicated across gslb federation. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - leader_cluster_uuid: - description: - - Mark this site as leader of gslb configuration. - - This site is the one among the avi sites. - required: true - maintenance_mode: - description: - - This field disables the configuration operations on the leader for all federated objects. - - Cud operations on gslb, gslbservice, gslbgeodbprofile and other federated objects will be rejected. - - The rest-api disabling helps in upgrade scenarios where we don't want configuration sync operations to the gslb member when the member is being - - upgraded. - - This configuration programmatically blocks the leader from accepting new gslb configuration when member sites are undergoing upgrade. - - Field introduced in 17.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - name: - description: - - Name for the gslb object. - required: true - send_interval: - description: - - Frequency with which group members communicate. - - Allowed values are 1-3600. - - Default value when not specified in API or module is interpreted by Avi Controller as 15. - send_interval_prior_to_maintenance_mode: - description: - - The user can specify a send-interval while entering maintenance mode. - - The validity of this 'maintenance send-interval' is only during maintenance mode. - - When the user leaves maintenance mode, the original send-interval is reinstated. - - This internal variable is used to store the original send-interval. - - Field introduced in 18.2.3. - sites: - description: - - Select avi site member belonging to this gslb. - tenant_ref: - description: - - It is a reference to an object of type tenant. - third_party_sites: - description: - - Third party site member belonging to this gslb. - - Field introduced in 17.1.1. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the gslb object. - view_id: - description: - - The view-id is used in change-leader mode to differentiate partitioned groups while they have the same gslb namespace. - - Each partitioned group will be able to operate independently by using the view-id. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create Gslb object - community.network.avi_gslb: - name: "test-gslb" - avi_credentials: - username: '{{ username }}' - password: '{{ password }}' - controller: '{{ controller }}' - sites: - - name: "test-site1" - username: "gslb_username" - password: "gslb_password" - ip_addresses: - - type: "V4" - addr: "10.10.28.83" - enabled: True - member_type: "GSLB_ACTIVE_MEMBER" - port: 443 - cluster_uuid: "cluster-d4ee5fcc-3e0a-4d4f-9ae6-4182bc605829" - - name: "test-site2" - username: "gslb_username" - password: "gslb_password" - ip_addresses: - - type: "V4" - addr: "10.10.28.86" - enabled: True - member_type: "GSLB_ACTIVE_MEMBER" - port: 443 - cluster_uuid: "cluster-0c37ae8d-ab62-410c-ad3e-06fa831950b1" - dns_configs: - - domain_name: "test1.com" - - domain_name: "test2.com" - leader_cluster_uuid: "cluster-d4ee5fcc-3e0a-4d4f-9ae6-4182bc605829" - -- name: Update Gslb site's configurations (Patch Add Operation) - community.network.avi_gslb: - avi_credentials: - username: '{{ username }}' - password: '{{ password }}' - controller: '{{ controller }}' - avi_api_update_method: patch - avi_api_patch_op: add - leader_cluster_uuid: "cluster-d4ee5fcc-3e0a-4d4f-9ae6-4182bc605829" - name: "test-gslb" - dns_configs: - - domain_name: "temp1.com" - - domain_name: "temp2.com" - gslb_sites_config: - - ip_addr: "10.10.28.83" - dns_vses: - - dns_vs_uuid: "virtualservice-f2a711cd-5e78-473f-8f47-d12de660fd62" - domain_names: - - "test1.com" - - "test2.com" - - ip_addr: "10.10.28.86" - dns_vses: - - dns_vs_uuid: "virtualservice-c1a63a16-f2a1-4f41-aab4-1e90f92a5e49" - domain_names: - - "temp1.com" - - "temp2.com" - -- name: Update Gslb site's configurations (Patch Replace Operation) - community.network.avi_gslb: - avi_credentials: - username: "{{ username }}" - password: "{{ password }}" - controller: "{{ controller }}" - # On basis of cluster leader uuid dns_configs is set for that particular leader cluster - leader_cluster_uuid: "cluster-84aa795f-8f09-42bb-97a4-5103f4a53da9" - name: "test-gslb" - avi_api_update_method: patch - avi_api_patch_op: replace - dns_configs: - - domain_name: "test3.com" - - domain_name: "temp3.com" - gslb_sites_config: - # Ip address is mapping key for dns_vses field update. For the given IP address, - # dns_vses is updated. - - ip_addr: "10.10.28.83" - dns_vses: - - dns_vs_uuid: "virtualservice-7c947ed4-77f3-4a52-909c-4f12afaf5bb0" - domain_names: - - "test3.com" - - ip_addr: "10.10.28.86" - dns_vses: - - dns_vs_uuid: "virtualservice-799b2c6d-7f2d-4c3f-94c6-6e813b20b674" - domain_names: - - "temp3.com" - -- name: Update Gslb site's configurations (Patch Delete Operation) - community.network.avi_gslb: - avi_credentials: - username: "{{ username }}" - password: "{{ password }}" - controller: "{{ controller }}" - # On basis of cluster leader uuid dns_configs is set for that particular leader cluster - leader_cluster_uuid: "cluster-84aa795f-8f09-42bb-97a4-5103f4a53da9" - name: "test-gslb" - avi_api_update_method: patch - avi_api_patch_op: delete - dns_configs: - gslb_sites_config: - - ip_addr: "10.10.28.83" - - ip_addr: "10.10.28.86" -""" - -RETURN = ''' -obj: - description: Gslb (api/gslb) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) - from ansible_collections.community.network.plugins.module_utils.network.avi.avi_api import ApiSession, AviCredentials -except ImportError: - HAS_AVI = False - - -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']), - async_interval=dict(type='int',), - clear_on_max_retries=dict(type='int',), - client_ip_addr_group=dict(type='dict',), - description=dict(type='str',), - dns_configs=dict(type='list',), - is_federated=dict(type='bool',), - leader_cluster_uuid=dict(type='str', required=True), - maintenance_mode=dict(type='bool',), - name=dict(type='str', required=True), - send_interval=dict(type='int',), - send_interval_prior_to_maintenance_mode=dict(type='int',), - sites=dict(type='list',), - tenant_ref=dict(type='str',), - third_party_sites=dict(type='list',), - url=dict(type='str',), - uuid=dict(type='str',), - view_id=dict(type='int',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - api_method = module.params['avi_api_update_method'] - if str(api_method).lower() == 'patch': - patch_op = module.params['avi_api_patch_op'] - # Create controller session - api_creds = AviCredentials() - api_creds.update_from_ansible_module(module) - api = ApiSession.get_session( - api_creds.controller, api_creds.username, password=api_creds.password, - timeout=api_creds.timeout, tenant=api_creds.tenant, - tenant_uuid=api_creds.tenant_uuid, token=api_creds.token, - port=api_creds.port) - # Get existing gslb objects - rsp = api.get('gslb', api_version=api_creds.api_version) - existing_gslb = rsp.json() - gslb = existing_gslb['results'] - sites = module.params['gslb_sites_config'] - for gslb_obj in gslb: - # Update/Delete domain names in dns_configs fields in gslb object. - if 'dns_configs' in module.params: - if gslb_obj['leader_cluster_uuid'] == module.params['leader_cluster_uuid']: - if str(patch_op).lower() == 'delete': - gslb_obj['dns_configs'] = [] - elif str(patch_op).lower() == 'add': - if module.params['dns_configs'] not in gslb_obj['dns_configs']: - gslb_obj['dns_configs'].extend(module.params['dns_configs']) - else: - gslb_obj['dns_configs'] = module.params['dns_configs'] - # Update/Delete sites configuration - if sites: - for site_obj in gslb_obj['sites']: - dns_vses = site_obj.get('dns_vses', []) - for obj in sites: - config_for = obj.get('ip_addr', None) - if not config_for: - return module.fail_json(msg=( - "ip_addr of site in a configuration is mandatory. " - "Please provide ip_addr i.e. gslb site's ip.")) - if config_for == site_obj['ip_addresses'][0]['addr']: - if str(patch_op).lower() == 'delete': - site_obj['dns_vses'] = [] - else: - # Modify existing gslb sites object - for key, val in obj.items(): - if key == 'dns_vses' and str(patch_op).lower() == 'add': - found = False - # Check dns_vses field already exists on the controller - for v in dns_vses: - if val[0]['dns_vs_uuid'] != v['dns_vs_uuid']: - found = True - break - if not found: - dns_vses.extend(val) - else: - site_obj[key] = val - if str(patch_op).lower() == 'add': - site_obj['dns_vses'] = dns_vses - uni_dns_configs = [dict(tupleized) for tupleized in set(tuple(item.items()) - for item in gslb_obj['dns_configs'])] - gslb_obj['dns_configs'] = uni_dns_configs - module.params.update(gslb_obj) - module.params.update( - { - 'avi_api_update_method': 'put', - 'state': 'present' - } - ) - return avi_ansible_api(module, 'gslb', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_gslbgeodbprofile.py b/plugins/modules/network/avi/avi_gslbgeodbprofile.py deleted file mode 100644 index 4a1ddf13..00000000 --- a/plugins/modules/network/avi/avi_gslbgeodbprofile.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.2 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_gslbgeodbprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of GslbGeoDbProfile Avi RESTful Object -description: - - This module is used to configure GslbGeoDbProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - description: - description: - - Field introduced in 17.1.1. - entries: - description: - - List of geodb entries. - - An entry can either be a geodb file or an ip address group with geo properties. - - Field introduced in 17.1.1. - is_federated: - description: - - This field indicates that this object is replicated across gslb federation. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - name: - description: - - A user-friendly name for the geodb profile. - - Field introduced in 17.1.1. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.1.1. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the geodb profile. - - Field introduced in 17.1.1. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create GslbGeoDbProfile object - community.network.avi_gslbgeodbprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_gslbgeodbprofile -""" - -RETURN = ''' -obj: - description: GslbGeoDbProfile (api/gslbgeodbprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - description=dict(type='str',), - entries=dict(type='list',), - is_federated=dict(type='bool',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'gslbgeodbprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_gslbservice.py b/plugins/modules/network/avi/avi_gslbservice.py deleted file mode 100644 index 4d63ea87..00000000 --- a/plugins/modules/network/avi/avi_gslbservice.py +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_gslbservice -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of GslbService Avi RESTful Object -description: - - This module is used to configure GslbService object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - application_persistence_profile_ref: - description: - - The federated application persistence associated with gslbservice site persistence functionality. - - It is a reference to an object of type applicationpersistenceprofile. - - Field introduced in 17.2.1. - controller_health_status_enabled: - description: - - Gs member's overall health status is derived based on a combination of controller and datapath health-status inputs. - - Note that the datapath status is determined by the association of health monitor profiles. - - Only the controller provided status is determined through this configuration. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - created_by: - description: - - Creator name. - - Field introduced in 17.1.2. - description: - description: - - User defined description for the object. - domain_names: - description: - - Fully qualified domain name of the gslb service. - down_response: - description: - - Response to the client query when the gslb service is down. - enabled: - description: - - Enable or disable the gslb service. - - If the gslb service is enabled, then the vips are sent in the dns responses based on reachability and configured algorithm. - - If the gslb service is disabled, then the vips are no longer available in the dns response. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - groups: - description: - - Select list of pools belonging to this gslb service. - health_monitor_refs: - description: - - Verify vs health by applying one or more health monitors. - - Active monitors generate synthetic traffic from dns service engine and to mark a vs up or down based on the response. - - It is a reference to an object of type healthmonitor. - health_monitor_scope: - description: - - Health monitor probe can be executed for all the members or it can be executed only for third-party members. - - This operational mode is useful to reduce the number of health monitor probes in case of a hybrid scenario. - - In such a case, avi members can have controller derived status while non-avi members can be probed by via health monitor probes in dataplane. - - Enum options - GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS, GSLB_SERVICE_HEALTH_MONITOR_ONLY_NON_AVI_MEMBERS. - - Default value when not specified in API or module is interpreted by Avi Controller as GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS. - hm_off: - description: - - This field is an internal field and is used in se. - - Field introduced in 18.2.2. - type: bool - is_federated: - description: - - This field indicates that this object is replicated across gslb federation. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - min_members: - description: - - The minimum number of members to distribute traffic to. - - Allowed values are 1-65535. - - Special values are 0 - 'disable'. - - Field introduced in 17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - name: - description: - - Name for the gslb service. - required: true - num_dns_ip: - description: - - Number of ip addresses of this gslb service to be returned by the dns service. - - Enter 0 to return all ip addresses. - - Allowed values are 1-20. - - Special values are 0- 'return all ip addresses'. - pool_algorithm: - description: - - The load balancing algorithm will pick a gslb pool within the gslb service list of available pools. - - Enum options - GSLB_SERVICE_ALGORITHM_PRIORITY, GSLB_SERVICE_ALGORITHM_GEO. - - Field introduced in 17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as GSLB_SERVICE_ALGORITHM_PRIORITY. - site_persistence_enabled: - description: - - Enable site-persistence for the gslbservice. - - Field introduced in 17.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - tenant_ref: - description: - - It is a reference to an object of type tenant. - ttl: - description: - - Ttl value (in seconds) for records served for this gslb service by the dns service. - - Allowed values are 0-86400. - url: - description: - - Avi controller URL of the object. - use_edns_client_subnet: - description: - - Use the client ip subnet from the edns option as source ipaddress for client geo-location and consistent hash algorithm. - - Default is true. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - uuid: - description: - - Uuid of the gslb service. - wildcard_match: - description: - - Enable wild-card match of fqdn if an exact match is not found in the dns table, the longest match is chosen by wild-carding the fqdn in the dns - - request. - - Default is false. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create GslbService object - community.network.avi_gslbservice: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_gslbservice -""" - -RETURN = ''' -obj: - description: GslbService (api/gslbservice) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - application_persistence_profile_ref=dict(type='str',), - controller_health_status_enabled=dict(type='bool',), - created_by=dict(type='str',), - description=dict(type='str',), - domain_names=dict(type='list',), - down_response=dict(type='dict',), - enabled=dict(type='bool',), - groups=dict(type='list',), - health_monitor_refs=dict(type='list',), - health_monitor_scope=dict(type='str',), - hm_off=dict(type='bool',), - is_federated=dict(type='bool',), - min_members=dict(type='int',), - name=dict(type='str', required=True), - num_dns_ip=dict(type='int',), - pool_algorithm=dict(type='str',), - site_persistence_enabled=dict(type='bool',), - tenant_ref=dict(type='str',), - ttl=dict(type='int',), - url=dict(type='str',), - use_edns_client_subnet=dict(type='bool',), - uuid=dict(type='str',), - wildcard_match=dict(type='bool',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'gslbservice', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_gslbservice_patch_member.py b/plugins/modules/network/avi/avi_gslbservice_patch_member.py deleted file mode 100644 index 62467d54..00000000 --- a/plugins/modules/network/avi/avi_gslbservice_patch_member.py +++ /dev/null @@ -1,292 +0,0 @@ -#!/usr/bin/python -""" -# Created on Aug 12, 2016 -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 -# -# module_check: supported -# -# Copyright: (c) 2016 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# -""" - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_gslbservice_patch_member -author: Gaurav Rastogi (@grastogi23) - -short_description: Avi API Module -description: - - This module can be used for calling any resources defined in Avi REST API. U(https://avinetworks.com/) - - This module is useful for invoking HTTP Patch methods and accessing resources that do not have an REST object associated with them. -requirements: [ avisdk ] -options: - data: - description: - - HTTP body of GSLB Service Member in YAML or JSON format. - params: - description: - - Query parameters passed to the HTTP API. - name: - description: - - Name of the GSLB Service - required: true - state: - description: - - The state that should be applied to the member. Member is - - identified using field member.ip.addr. - default: present - choices: ["absent","present"] -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = ''' - - name: Patch GSLB Service to add a new member and group - community.network.avi_gslbservice_patch_member: - controller: "{{ controller }}" - username: "{{ username }}" - password: "{{ password }}" - name: gs-3 - api_version: 17.2.1 - data: - group: - name: newfoo - priority: 60 - members: - - enabled: true - ip: - addr: 10.30.10.66 - type: V4 - ratio: 3 - - name: Patch GSLB Service to delete an existing member - community.network.avi_gslbservice_patch_member: - controller: "{{ controller }}" - username: "{{ username }}" - password: "{{ password }}" - name: gs-3 - state: absent - api_version: 17.2.1 - data: - group: - name: newfoo - members: - - enabled: true - ip: - addr: 10.30.10.68 - type: V4 - ratio: 3 - - name: Update priority of GSLB Service Pool - community.network.avi_gslbservice_patch_member: - controller: "" - username: "" - password: "" - name: gs-3 - state: present - api_version: 17.2.1 - data: - group: - name: newfoo - priority: 42 -''' - - -RETURN = ''' -obj: - description: Avi REST resource - returned: success, changed - type: dict -''' - -import json -import time -from ansible.module_utils.basic import AnsibleModule -from copy import deepcopy - -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_obj_cmp, cleanup_absent_fields, - ansible_return, AviCheckModeResponse, HAS_AVI) - from ansible_collections.community.network.plugins.module_utils.network.avi.avi_api import ( - ApiSession, AviCredentials) -except ImportError: - HAS_AVI = False - - -def delete_member(module, check_mode, api, tenant, tenant_uuid, - existing_obj, data, api_version): - members = data.get('group', {}).get('members', []) - patched_member_ids = set([m['ip']['addr'] for m in members if 'fqdn' not in m]) - patched_member_fqdns = set([m['fqdn'] for m in members if 'fqdn' in m]) - - changed = False - rsp = None - - if existing_obj and (patched_member_ids or patched_member_fqdns): - groups = [group for group in existing_obj.get('groups', []) - if group['name'] == data['group']['name']] - if groups: - changed = any( - [(lambda g: g['ip']['addr'] in patched_member_ids)(m) - for m in groups[0].get('members', []) if 'fqdn' not in m]) - changed = changed or any( - [(lambda g: g['fqdn'] in patched_member_fqdns)(m) - for m in groups[0].get('members', []) if 'fqdn' in m]) - if check_mode or not changed: - return changed, rsp - # should not come here if not found - group = groups[0] - new_members = [] - for m in group.get('members', []): - if 'fqdn' in m: - if m['fqdn'] not in patched_member_fqdns: - new_members.append(m) - elif 'ip' in m: - if m['ip']['addr'] not in patched_member_ids: - new_members.append(m) - group['members'] = new_members - if not group['members']: - # Delete this group from the existing objects if it is empty. - # Controller also does not allow empty group. - existing_obj['groups'] = [ - grp for grp in existing_obj.get('groups', []) if - grp['name'] != data['group']['name']] - # remove the members that are part of the list - # update the object - # added api version for AVI api call. - rsp = api.put('gslbservice/%s' % existing_obj['uuid'], data=existing_obj, - tenant=tenant, tenant_uuid=tenant_uuid, api_version=api_version) - return changed, rsp - - -def add_member(module, check_mode, api, tenant, tenant_uuid, - existing_obj, data, name, api_version): - rsp = None - if not existing_obj: - # create the object - changed = True - if check_mode: - rsp = AviCheckModeResponse(obj=None) - else: - # creates group with single member - req = {'name': name, - 'groups': [data['group']] - } - # added api version for AVI api call. - rsp = api.post('gslbservice', data=req, tenant=tenant, - tenant_uuid=tenant_uuid, api_version=api_version) - else: - # found GSLB object - req = deepcopy(existing_obj) - if 'groups' not in req: - req['groups'] = [] - groups = [group for group in req['groups'] - if group['name'] == data['group']['name']] - if not groups: - # did not find the group - req['groups'].append(data['group']) - else: - # just update the existing group with members - group = groups[0] - group_info_wo_members = deepcopy(data['group']) - group_info_wo_members.pop('members', None) - group.update(group_info_wo_members) - if 'members' not in group: - group['members'] = [] - new_members = [] - for patch_member in data['group'].get('members', []): - found = False - for m in group['members']: - if 'fqdn' in patch_member and m.get('fqdn', '') == patch_member['fqdn']: - found = True - break - elif m['ip']['addr'] == patch_member['ip']['addr']: - found = True - break - if not found: - new_members.append(patch_member) - else: - m.update(patch_member) - # add any new members - group['members'].extend(new_members) - cleanup_absent_fields(req) - changed = not avi_obj_cmp(req, existing_obj) - if changed and not check_mode: - obj_path = '%s/%s' % ('gslbservice', existing_obj['uuid']) - # added api version for AVI api call. - rsp = api.put(obj_path, data=req, tenant=tenant, - tenant_uuid=tenant_uuid, api_version=api_version) - return changed, rsp - - -def main(): - argument_specs = dict( - params=dict(type='dict'), - data=dict(type='dict'), - name=dict(type='str', required=True), - state=dict(default='present', - choices=['absent', 'present']) - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule(argument_spec=argument_specs) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or ansible>=2.8 is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - api_creds = AviCredentials() - api_creds.update_from_ansible_module(module) - api = ApiSession.get_session( - api_creds.controller, api_creds.username, password=api_creds.password, - timeout=api_creds.timeout, tenant=api_creds.tenant, - tenant_uuid=api_creds.tenant_uuid, token=api_creds.token, - port=api_creds.port) - - tenant = api_creds.tenant - tenant_uuid = api_creds.tenant_uuid - params = module.params.get('params', None) - data = module.params.get('data', None) - gparams = deepcopy(params) if params else {} - gparams.update({'include_refs': '', 'include_name': ''}) - name = module.params.get('name', '') - state = module.params['state'] - # Get the api version from module. - api_version = api_creds.api_version - """ - state: present - 1. Check if the GSLB service is present - 2. If not then create the GSLB service with the member - 3. Check if the group exists - 4. if not then create the group with the member - 5. Check if the member is present - if not then add the member - state: absent - 1. check if GSLB service is present if not then exit - 2. check if group is present. if not then exit - 3. check if member is present. if present then remove it. - """ - obj_type = 'gslbservice' - # Added api version to call - existing_obj = api.get_object_by_name( - obj_type, name, tenant=tenant, tenant_uuid=tenant_uuid, - params={'include_refs': '', 'include_name': ''}, api_version=api_version) - check_mode = module.check_mode - if state == 'absent': - # Added api version to call - changed, rsp = delete_member(module, check_mode, api, tenant, - tenant_uuid, existing_obj, data, api_version) - else: - # Added api version to call - changed, rsp = add_member(module, check_mode, api, tenant, tenant_uuid, - existing_obj, data, name, api_version) - if check_mode or not changed: - return module.exit_json(changed=changed, obj=existing_obj) - return ansible_return(module, rsp, changed, req=data) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py b/plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py deleted file mode 100644 index 23ab69cc..00000000 --- a/plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_hardwaresecuritymodulegroup -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of HardwareSecurityModuleGroup Avi RESTful Object -description: - - This module is used to configure HardwareSecurityModuleGroup object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - hsm: - description: - - Hardware security module configuration. - required: true - name: - description: - - Name of the hsm group configuration object. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the hsm group configuration object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create HardwareSecurityModuleGroup object - community.network.avi_hardwaresecuritymodulegroup: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_hardwaresecuritymodulegroup -""" - -RETURN = ''' -obj: - description: HardwareSecurityModuleGroup (api/hardwaresecuritymodulegroup) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - hsm=dict(type='dict', required=True), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'hardwaresecuritymodulegroup', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_healthmonitor.py b/plugins/modules/network/avi/avi_healthmonitor.py deleted file mode 100644 index a58d7b2f..00000000 --- a/plugins/modules/network/avi/avi_healthmonitor.py +++ /dev/null @@ -1,204 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_healthmonitor -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of HealthMonitor Avi RESTful Object -description: - - This module is used to configure HealthMonitor object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - description: - description: - - User defined description for the object. - dns_monitor: - description: - - Healthmonitordns settings for healthmonitor. - external_monitor: - description: - - Healthmonitorexternal settings for healthmonitor. - failed_checks: - description: - - Number of continuous failed health checks before the server is marked down. - - Allowed values are 1-50. - - Default value when not specified in API or module is interpreted by Avi Controller as 2. - http_monitor: - description: - - Healthmonitorhttp settings for healthmonitor. - https_monitor: - description: - - Healthmonitorhttp settings for healthmonitor. - is_federated: - description: - - This field describes the object's replication scope. - - If the field is set to false, then the object is visible within the controller-cluster and its associated service-engines. - - If the field is set to true, then the object is replicated across the federation. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - monitor_port: - description: - - Use this port instead of the port defined for the server in the pool. - - If the monitor succeeds to this port, the load balanced traffic will still be sent to the port of the server defined within the pool. - - Allowed values are 1-65535. - - Special values are 0 - 'use server port'. - name: - description: - - A user friendly name for this health monitor. - required: true - radius_monitor: - description: - - Health monitor for radius. - - Field introduced in 18.2.3. - receive_timeout: - description: - - A valid response from the server is expected within the receive timeout window. - - This timeout must be less than the send interval. - - If server status is regularly flapping up and down, consider increasing this value. - - Allowed values are 1-2400. - - Default value when not specified in API or module is interpreted by Avi Controller as 4. - send_interval: - description: - - Frequency, in seconds, that monitors are sent to a server. - - Allowed values are 1-3600. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - sip_monitor: - description: - - Health monitor for sip. - - Field introduced in 17.2.8, 18.1.3, 18.2.1. - successful_checks: - description: - - Number of continuous successful health checks before server is marked up. - - Allowed values are 1-50. - - Default value when not specified in API or module is interpreted by Avi Controller as 2. - tcp_monitor: - description: - - Healthmonitortcp settings for healthmonitor. - tenant_ref: - description: - - It is a reference to an object of type tenant. - type: - description: - - Type of the health monitor. - - Enum options - HEALTH_MONITOR_PING, HEALTH_MONITOR_TCP, HEALTH_MONITOR_HTTP, HEALTH_MONITOR_HTTPS, HEALTH_MONITOR_EXTERNAL, HEALTH_MONITOR_UDP, - - HEALTH_MONITOR_DNS, HEALTH_MONITOR_GSLB, HEALTH_MONITOR_SIP, HEALTH_MONITOR_RADIUS. - required: true - udp_monitor: - description: - - Healthmonitorudp settings for healthmonitor. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the health monitor. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Create a HTTPS health monitor - community.network.avi_healthmonitor: - controller: 10.10.27.90 - username: admin - password: AviNetworks123! - https_monitor: - http_request: HEAD / HTTP/1.0 - http_response_code: - - HTTP_2XX - - HTTP_3XX - receive_timeout: 4 - failed_checks: 3 - send_interval: 10 - successful_checks: 3 - type: HEALTH_MONITOR_HTTPS - name: MyWebsite-HTTPS -""" - -RETURN = ''' -obj: - description: HealthMonitor (api/healthmonitor) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - description=dict(type='str',), - dns_monitor=dict(type='dict',), - external_monitor=dict(type='dict',), - failed_checks=dict(type='int',), - http_monitor=dict(type='dict',), - https_monitor=dict(type='dict',), - is_federated=dict(type='bool',), - monitor_port=dict(type='int',), - name=dict(type='str', required=True), - radius_monitor=dict(type='dict',), - receive_timeout=dict(type='int',), - send_interval=dict(type='int',), - sip_monitor=dict(type='dict',), - successful_checks=dict(type='int',), - tcp_monitor=dict(type='dict',), - tenant_ref=dict(type='str',), - type=dict(type='str', required=True), - udp_monitor=dict(type='dict',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'healthmonitor', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_httppolicyset.py b/plugins/modules/network/avi/avi_httppolicyset.py deleted file mode 100644 index ac04244c..00000000 --- a/plugins/modules/network/avi/avi_httppolicyset.py +++ /dev/null @@ -1,168 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_httppolicyset -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of HTTPPolicySet Avi RESTful Object -description: - - This module is used to configure HTTPPolicySet object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cloud_config_cksum: - description: - - Checksum of cloud configuration for pool. - - Internally set by cloud connector. - created_by: - description: - - Creator name. - description: - description: - - User defined description for the object. - http_request_policy: - description: - - Http request policy for the virtual service. - http_response_policy: - description: - - Http response policy for the virtual service. - http_security_policy: - description: - - Http security policy for the virtual service. - is_internal_policy: - description: - - Boolean flag to set is_internal_policy. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - name: - description: - - Name of the http policy set. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the http policy set. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Create a HTTP Policy set two switch between testpool1 and testpool2 - community.network.avi_httppolicyset: - controller: 10.10.27.90 - username: admin - password: AviNetworks123! - name: test-HTTP-Policy-Set - tenant_ref: admin - http_request_policy: - rules: - - index: 1 - enable: true - name: test-test1 - match: - path: - match_case: INSENSITIVE - match_str: - - /test1 - match_criteria: EQUALS - switching_action: - action: HTTP_SWITCHING_SELECT_POOL - status_code: HTTP_LOCAL_RESPONSE_STATUS_CODE_200 - pool_ref: "/api/pool?name=testpool1" - - index: 2 - enable: true - name: test-test2 - match: - path: - match_case: INSENSITIVE - match_str: - - /test2 - match_criteria: CONTAINS - switching_action: - action: HTTP_SWITCHING_SELECT_POOL - status_code: HTTP_LOCAL_RESPONSE_STATUS_CODE_200 - pool_ref: "/api/pool?name=testpool2" - is_internal_policy: false -""" - -RETURN = ''' -obj: - description: HTTPPolicySet (api/httppolicyset) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cloud_config_cksum=dict(type='str',), - created_by=dict(type='str',), - description=dict(type='str',), - http_request_policy=dict(type='dict',), - http_response_policy=dict(type='dict',), - http_security_policy=dict(type='dict',), - is_internal_policy=dict(type='bool',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'httppolicyset', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_ipaddrgroup.py b/plugins/modules/network/avi/avi_ipaddrgroup.py deleted file mode 100644 index 52ae9405..00000000 --- a/plugins/modules/network/avi/avi_ipaddrgroup.py +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_ipaddrgroup -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of IpAddrGroup Avi RESTful Object -description: - - This module is used to configure IpAddrGroup object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - addrs: - description: - - Configure ip address(es). - apic_epg_name: - description: - - Populate ip addresses from members of this cisco apic epg. - country_codes: - description: - - Populate the ip address ranges from the geo database for this country. - description: - description: - - User defined description for the object. - ip_ports: - description: - - Configure (ip address, port) tuple(s). - marathon_app_name: - description: - - Populate ip addresses from tasks of this marathon app. - marathon_service_port: - description: - - Task port associated with marathon service port. - - If marathon app has multiple service ports, this is required. - - Else, the first task port is used. - name: - description: - - Name of the ip address group. - required: true - prefixes: - description: - - Configure ip address prefix(es). - ranges: - description: - - Configure ip address range(s). - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the ip address group. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create an IP Address Group configuration - community.network.avi_ipaddrgroup: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - name: Client-Source-Block - prefixes: - - ip_addr: - addr: 10.0.0.0 - type: V4 - mask: 8 - - ip_addr: - addr: 172.16.0.0 - type: V4 - mask: 12 - - ip_addr: - addr: 192.168.0.0 - type: V4 - mask: 16 -""" - -RETURN = ''' -obj: - description: IpAddrGroup (api/ipaddrgroup) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - addrs=dict(type='list',), - apic_epg_name=dict(type='str',), - country_codes=dict(type='list',), - description=dict(type='str',), - ip_ports=dict(type='list',), - marathon_app_name=dict(type='str',), - marathon_service_port=dict(type='int',), - name=dict(type='str', required=True), - prefixes=dict(type='list',), - ranges=dict(type='list',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'ipaddrgroup', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_ipamdnsproviderprofile.py b/plugins/modules/network/avi/avi_ipamdnsproviderprofile.py deleted file mode 100644 index 3e50bd8e..00000000 --- a/plugins/modules/network/avi/avi_ipamdnsproviderprofile.py +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_ipamdnsproviderprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of IpamDnsProviderProfile Avi RESTful Object -description: - - This module is used to configure IpamDnsProviderProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - allocate_ip_in_vrf: - description: - - If this flag is set, only allocate ip from networks in the virtual service vrf. - - Applicable for avi vantage ipam only. - - Field introduced in 17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - aws_profile: - description: - - Provider details if type is aws. - azure_profile: - description: - - Provider details if type is microsoft azure. - - Field introduced in 17.2.1. - custom_profile: - description: - - Provider details if type is custom. - - Field introduced in 17.1.1. - gcp_profile: - description: - - Provider details if type is google cloud. - infoblox_profile: - description: - - Provider details if type is infoblox. - internal_profile: - description: - - Provider details if type is avi. - name: - description: - - Name for the ipam/dns provider profile. - required: true - oci_profile: - description: - - Provider details for oracle cloud. - - Field introduced in 18.2.1,18.1.3. - openstack_profile: - description: - - Provider details if type is openstack. - proxy_configuration: - description: - - Field introduced in 17.1.1. - tenant_ref: - description: - - It is a reference to an object of type tenant. - tencent_profile: - description: - - Provider details for tencent cloud. - - Field introduced in 18.2.3. - type: - description: - - Provider type for the ipam/dns provider profile. - - Enum options - IPAMDNS_TYPE_INFOBLOX, IPAMDNS_TYPE_AWS, IPAMDNS_TYPE_OPENSTACK, IPAMDNS_TYPE_GCP, IPAMDNS_TYPE_INFOBLOX_DNS, IPAMDNS_TYPE_CUSTOM, - - IPAMDNS_TYPE_CUSTOM_DNS, IPAMDNS_TYPE_AZURE, IPAMDNS_TYPE_OCI, IPAMDNS_TYPE_TENCENT, IPAMDNS_TYPE_INTERNAL, IPAMDNS_TYPE_INTERNAL_DNS, - - IPAMDNS_TYPE_AWS_DNS, IPAMDNS_TYPE_AZURE_DNS. - required: true - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the ipam/dns provider profile. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create IPAM DNS provider setting - community.network.avi_ipamdnsproviderprofile: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - internal_profile: - dns_service_domain: - - domain_name: ashish.local - num_dns_ip: 1 - pass_through: true - record_ttl: 100 - - domain_name: guru.local - num_dns_ip: 1 - pass_through: true - record_ttl: 200 - ttl: 300 - name: Ashish-DNS - tenant_ref: Demo - type: IPAMDNS_TYPE_INTERNAL -""" - -RETURN = ''' -obj: - description: IpamDnsProviderProfile (api/ipamdnsproviderprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - allocate_ip_in_vrf=dict(type='bool',), - aws_profile=dict(type='dict',), - azure_profile=dict(type='dict',), - custom_profile=dict(type='dict',), - gcp_profile=dict(type='dict',), - infoblox_profile=dict(type='dict',), - internal_profile=dict(type='dict',), - name=dict(type='str', required=True), - oci_profile=dict(type='dict',), - openstack_profile=dict(type='dict',), - proxy_configuration=dict(type='dict',), - tenant_ref=dict(type='str',), - tencent_profile=dict(type='dict',), - type=dict(type='str', required=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'ipamdnsproviderprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_l4policyset.py b/plugins/modules/network/avi/avi_l4policyset.py deleted file mode 100644 index d9ef7aa9..00000000 --- a/plugins/modules/network/avi/avi_l4policyset.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_l4policyset -author: Chaitanya Deshpande (@chaitanyaavi) - -short_description: Module for setup of L4PolicySet Avi RESTful Object -description: - - This module is used to configure L4PolicySet object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - created_by: - description: - - Creator name. - - Field introduced in 17.2.7. - description: - description: - - Field introduced in 17.2.7. - is_internal_policy: - description: - - Field introduced in 17.2.7. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - l4_connection_policy: - description: - - Policy to apply when a new transport connection is setup. - - Field introduced in 17.2.7. - name: - description: - - Name of the l4 policy set. - - Field introduced in 17.2.7. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.2.7. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Id of the l4 policy set. - - Field introduced in 17.2.7. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create L4PolicySet object - community.network.avi_l4policyset: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_l4policyset -""" - -RETURN = ''' -obj: - description: L4PolicySet (api/l4policyset) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - created_by=dict(type='str',), - description=dict(type='str',), - is_internal_policy=dict(type='bool',), - l4_connection_policy=dict(type='dict',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'l4policyset', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_microservicegroup.py b/plugins/modules/network/avi/avi_microservicegroup.py deleted file mode 100644 index d9bdf00a..00000000 --- a/plugins/modules/network/avi/avi_microservicegroup.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_microservicegroup -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of MicroServiceGroup Avi RESTful Object -description: - - This module is used to configure MicroServiceGroup object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - created_by: - description: - - Creator name. - description: - description: - - User defined description for the object. - name: - description: - - Name of the microservice group. - required: true - service_refs: - description: - - Configure microservice(es). - - It is a reference to an object of type microservice. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the microservice group. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create a Microservice Group that can be used for setting up Network security policy - community.network.avi_microservicegroup: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - description: Group created by my Secure My App UI. - name: vs-msg-marketing - tenant_ref: admin -""" - -RETURN = ''' -obj: - description: MicroServiceGroup (api/microservicegroup) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - created_by=dict(type='str',), - description=dict(type='str',), - name=dict(type='str', required=True), - service_refs=dict(type='list',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'microservicegroup', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_network.py b/plugins/modules/network/avi/avi_network.py deleted file mode 100644 index 5704f264..00000000 --- a/plugins/modules/network/avi/avi_network.py +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_network -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Network Avi RESTful Object -description: - - This module is used to configure Network object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cloud_ref: - description: - - It is a reference to an object of type cloud. - configured_subnets: - description: - - List of subnet. - dhcp_enabled: - description: - - Select the ip address management scheme for this network. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - exclude_discovered_subnets: - description: - - When selected, excludes all discovered subnets in this network from consideration for virtual service placement. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - ip6_autocfg_enabled: - description: - - Enable ipv6 auto configuration. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - name: - description: - - Name of the object. - required: true - synced_from_se: - description: - - Boolean flag to set synced_from_se. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. - vcenter_dvs: - description: - - Boolean flag to set vcenter_dvs. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - vimgrnw_ref: - description: - - It is a reference to an object of type vimgrnwruntime. - vrf_context_ref: - description: - - It is a reference to an object of type vrfcontext. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create Network object - community.network.avi_network: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_network -""" - -RETURN = ''' -obj: - description: Network (api/network) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cloud_ref=dict(type='str',), - configured_subnets=dict(type='list',), - dhcp_enabled=dict(type='bool',), - exclude_discovered_subnets=dict(type='bool',), - ip6_autocfg_enabled=dict(type='bool',), - name=dict(type='str', required=True), - synced_from_se=dict(type='bool',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - vcenter_dvs=dict(type='bool',), - vimgrnw_ref=dict(type='str',), - vrf_context_ref=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'network', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_networkprofile.py b/plugins/modules/network/avi/avi_networkprofile.py deleted file mode 100644 index 00ff2cd6..00000000 --- a/plugins/modules/network/avi/avi_networkprofile.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_networkprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of NetworkProfile Avi RESTful Object -description: - - This module is used to configure NetworkProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - connection_mirror: - description: - - When enabled, avi mirrors all tcp fastpath connections to standby. - - Applicable only in legacy ha mode. - - Field introduced in 18.1.3,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - description: - description: - - User defined description for the object. - name: - description: - - The name of the network profile. - required: true - profile: - description: - - Networkprofileunion settings for networkprofile. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the network profile. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create a network profile for an UDP application - community.network.avi_networkprofile: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - name: System-UDP-Fast-Path - profile: - type: PROTOCOL_TYPE_UDP_FAST_PATH - udp_fast_path_profile: - per_pkt_loadbalance: false - session_idle_timeout: 10 - snat: true - tenant_ref: admin -""" - -RETURN = ''' -obj: - description: NetworkProfile (api/networkprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - connection_mirror=dict(type='bool',), - description=dict(type='str',), - name=dict(type='str', required=True), - profile=dict(type='dict', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'networkprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_networksecuritypolicy.py b/plugins/modules/network/avi/avi_networksecuritypolicy.py deleted file mode 100644 index 92343848..00000000 --- a/plugins/modules/network/avi/avi_networksecuritypolicy.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_networksecuritypolicy -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of NetworkSecurityPolicy Avi RESTful Object -description: - - This module is used to configure NetworkSecurityPolicy object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cloud_config_cksum: - description: - - Checksum of cloud configuration for network sec policy. - - Internally set by cloud connector. - created_by: - description: - - Creator name. - description: - description: - - User defined description for the object. - name: - description: - - Name of the object. - rules: - description: - - List of networksecurityrule. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create a network security policy to block clients represented by ip group known_attackers - community.network.avi_networksecuritypolicy: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - name: vs-gurutest-ns - rules: - - action: NETWORK_SECURITY_POLICY_ACTION_TYPE_DENY - age: 0 - enable: true - index: 1 - log: false - match: - client_ip: - group_refs: - - Demo:known_attackers - match_criteria: IS_IN - name: Rule 1 - tenant_ref: Demo -""" - -RETURN = ''' -obj: - description: NetworkSecurityPolicy (api/networksecuritypolicy) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cloud_config_cksum=dict(type='str',), - created_by=dict(type='str',), - description=dict(type='str',), - name=dict(type='str',), - rules=dict(type='list',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'networksecuritypolicy', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_pkiprofile.py b/plugins/modules/network/avi/avi_pkiprofile.py deleted file mode 100644 index 7107f28a..00000000 --- a/plugins/modules/network/avi/avi_pkiprofile.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_pkiprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of PKIProfile Avi RESTful Object -description: - - This module is used to configure PKIProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - ca_certs: - description: - - List of certificate authorities (root and intermediate) trusted that is used for certificate validation. - created_by: - description: - - Creator name. - crl_check: - description: - - When enabled, avi will verify via crl checks that certificates in the trust chain have not been revoked. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - crls: - description: - - Certificate revocation lists. - ignore_peer_chain: - description: - - When enabled, avi will not trust intermediate and root certs presented by a client. - - Instead, only the chain certs configured in the certificate authority section will be used to verify trust of the client's cert. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - is_federated: - description: - - This field describes the object's replication scope. - - If the field is set to false, then the object is visible within the controller-cluster and its associated service-engines. - - If the field is set to true, then the object is replicated across the federation. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - name: - description: - - Name of the pki profile. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. - validate_only_leaf_crl: - description: - - When enabled, avi will only validate the revocation status of the leaf certificate using crl. - - To enable validation for the entire chain, disable this option and provide all the relevant crls. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create PKIProfile object - community.network.avi_pkiprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_pkiprofile -""" - -RETURN = ''' -obj: - description: PKIProfile (api/pkiprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - ca_certs=dict(type='list',), - created_by=dict(type='str',), - crl_check=dict(type='bool',), - crls=dict(type='list',), - ignore_peer_chain=dict(type='bool',), - is_federated=dict(type='bool',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - validate_only_leaf_crl=dict(type='bool',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'pkiprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_pool.py b/plugins/modules/network/avi/avi_pool.py deleted file mode 100644 index 231e40db..00000000 --- a/plugins/modules/network/avi/avi_pool.py +++ /dev/null @@ -1,497 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_pool -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Pool Avi RESTful Object -description: - - This module is used to configure Pool object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - a_pool: - description: - - Name of container cloud application that constitutes a pool in a a-b pool configuration, if different from vs app. - - Field deprecated in 18.1.2. - ab_pool: - description: - - A/b pool configuration. - - Field deprecated in 18.1.2. - ab_priority: - description: - - Priority of this pool in a a-b pool pair. - - Internally used. - - Field deprecated in 18.1.2. - analytics_policy: - description: - - Determines analytics settings for the pool. - - Field introduced in 18.1.5, 18.2.1. - analytics_profile_ref: - description: - - Specifies settings related to analytics. - - It is a reference to an object of type analyticsprofile. - - Field introduced in 18.1.4,18.2.1. - apic_epg_name: - description: - - Synchronize cisco apic epg members with pool servers. - application_persistence_profile_ref: - description: - - Persistence will ensure the same user sticks to the same server for a desired duration of time. - - It is a reference to an object of type applicationpersistenceprofile. - autoscale_launch_config_ref: - description: - - If configured then avi will trigger orchestration of pool server creation and deletion. - - It is only supported for container clouds like mesos, openshift, kubernetes, docker, etc. - - It is a reference to an object of type autoscalelaunchconfig. - autoscale_networks: - description: - - Network ids for the launch configuration. - autoscale_policy_ref: - description: - - Reference to server autoscale policy. - - It is a reference to an object of type serverautoscalepolicy. - capacity_estimation: - description: - - Inline estimation of capacity of servers. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - capacity_estimation_ttfb_thresh: - description: - - The maximum time-to-first-byte of a server. - - Allowed values are 1-5000. - - Special values are 0 - 'automatic'. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - cloud_config_cksum: - description: - - Checksum of cloud configuration for pool. - - Internally set by cloud connector. - cloud_ref: - description: - - It is a reference to an object of type cloud. - conn_pool_properties: - description: - - Connection pool properties. - - Field introduced in 18.2.1. - connection_ramp_duration: - description: - - Duration for which new connections will be gradually ramped up to a server recently brought online. - - Useful for lb algorithms that are least connection based. - - Allowed values are 1-300. - - Special values are 0 - 'immediate'. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - created_by: - description: - - Creator name. - default_server_port: - description: - - Traffic sent to servers will use this destination server port unless overridden by the server's specific port attribute. - - The ssl checkbox enables avi to server encryption. - - Allowed values are 1-65535. - - Default value when not specified in API or module is interpreted by Avi Controller as 80. - delete_server_on_dns_refresh: - description: - - Indicates whether existing ips are disabled(false) or deleted(true) on dns hostname refreshdetail -- on a dns refresh, some ips set on pool may - - no longer be returned by the resolver. - - These ips are deleted from the pool when this knob is set to true. - - They are disabled, if the knob is set to false. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - description: - description: - - A description of the pool. - domain_name: - description: - - Comma separated list of domain names which will be used to verify the common names or subject alternative names presented by server certificates. - - It is performed only when common name check host_check_enabled is enabled. - east_west: - description: - - Inherited config from virtualservice. - type: bool - enabled: - description: - - Enable or disable the pool. - - Disabling will terminate all open connections and pause health monitors. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - external_autoscale_groups: - description: - - Names of external auto-scale groups for pool servers. - - Currently available only for aws and azure. - - Field introduced in 17.1.2. - fail_action: - description: - - Enable an action - close connection, http redirect or local http response - when a pool failure happens. - - By default, a connection will be closed, in case the pool experiences a failure. - fewest_tasks_feedback_delay: - description: - - Periodicity of feedback for fewest tasks server selection algorithm. - - Allowed values are 1-300. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - graceful_disable_timeout: - description: - - Used to gracefully disable a server. - - Virtual service waits for the specified time before terminating the existing connections to the servers that are disabled. - - Allowed values are 1-7200. - - Special values are 0 - 'immediate', -1 - 'infinite'. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - gslb_sp_enabled: - description: - - Indicates if the pool is a site-persistence pool. - - Field introduced in 17.2.1. - type: bool - health_monitor_refs: - description: - - Verify server health by applying one or more health monitors. - - Active monitors generate synthetic traffic from each service engine and mark a server up or down based on the response. - - The passive monitor listens only to client to server communication. - - It raises or lowers the ratio of traffic destined to a server based on successful responses. - - It is a reference to an object of type healthmonitor. - host_check_enabled: - description: - - Enable common name check for server certificate. - - If enabled and no explicit domain name is specified, avi will use the incoming host header to do the match. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - inline_health_monitor: - description: - - The passive monitor will monitor client to server connections and requests and adjust traffic load to servers based on successful responses. - - This may alter the expected behavior of the lb method, such as round robin. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - ipaddrgroup_ref: - description: - - Use list of servers from ip address group. - - It is a reference to an object of type ipaddrgroup. - lb_algorithm: - description: - - The load balancing algorithm will pick a server within the pool's list of available servers. - - Enum options - LB_ALGORITHM_LEAST_CONNECTIONS, LB_ALGORITHM_ROUND_ROBIN, LB_ALGORITHM_FASTEST_RESPONSE, LB_ALGORITHM_CONSISTENT_HASH, - - LB_ALGORITHM_LEAST_LOAD, LB_ALGORITHM_FEWEST_SERVERS, LB_ALGORITHM_RANDOM, LB_ALGORITHM_FEWEST_TASKS, LB_ALGORITHM_NEAREST_SERVER, - - LB_ALGORITHM_CORE_AFFINITY, LB_ALGORITHM_TOPOLOGY. - - Default value when not specified in API or module is interpreted by Avi Controller as LB_ALGORITHM_LEAST_CONNECTIONS. - lb_algorithm_consistent_hash_hdr: - description: - - Http header name to be used for the hash key. - lb_algorithm_core_nonaffinity: - description: - - Degree of non-affinity for core affinity based server selection. - - Allowed values are 1-65535. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 2. - lb_algorithm_hash: - description: - - Criteria used as a key for determining the hash between the client and server. - - Enum options - LB_ALGORITHM_CONSISTENT_HASH_SOURCE_IP_ADDRESS, LB_ALGORITHM_CONSISTENT_HASH_SOURCE_IP_ADDRESS_AND_PORT, - - LB_ALGORITHM_CONSISTENT_HASH_URI, LB_ALGORITHM_CONSISTENT_HASH_CUSTOM_HEADER, LB_ALGORITHM_CONSISTENT_HASH_CUSTOM_STRING, - - LB_ALGORITHM_CONSISTENT_HASH_CALLID. - - Default value when not specified in API or module is interpreted by Avi Controller as LB_ALGORITHM_CONSISTENT_HASH_SOURCE_IP_ADDRESS. - lookup_server_by_name: - description: - - Allow server lookup by name. - - Field introduced in 17.1.11,17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - max_concurrent_connections_per_server: - description: - - The maximum number of concurrent connections allowed to each server within the pool. - - Note applied value will be no less than the number of service engines that the pool is placed on. - - If set to 0, no limit is applied. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - max_conn_rate_per_server: - description: - - Rate limit connections to each server. - min_health_monitors_up: - description: - - Minimum number of health monitors in up state to mark server up. - - Field introduced in 18.2.1, 17.2.12. - min_servers_up: - description: - - Minimum number of servers in up state for marking the pool up. - - Field introduced in 18.2.1, 17.2.12. - name: - description: - - The name of the pool. - required: true - networks: - description: - - (internal-use) networks designated as containing servers for this pool. - - The servers may be further narrowed down by a filter. - - This field is used internally by avi, not editable by the user. - nsx_securitygroup: - description: - - A list of nsx service groups where the servers for the pool are created. - - Field introduced in 17.1.1. - pki_profile_ref: - description: - - Avi will validate the ssl certificate present by a server against the selected pki profile. - - It is a reference to an object of type pkiprofile. - placement_networks: - description: - - Manually select the networks and subnets used to provide reachability to the pool's servers. - - Specify the subnet using the following syntax 10-1-1-0/24. - - Use static routes in vrf configuration when pool servers are not directly connected butroutable from the service engine. - prst_hdr_name: - description: - - Header name for custom header persistence. - - Field deprecated in 18.1.2. - request_queue_depth: - description: - - Minimum number of requests to be queued when pool is full. - - Default value when not specified in API or module is interpreted by Avi Controller as 128. - request_queue_enabled: - description: - - Enable request queue when pool is full. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - rewrite_host_header_to_server_name: - description: - - Rewrite incoming host header to server name of the server to which the request is proxied. - - Enabling this feature rewrites host header for requests to all servers in the pool. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - rewrite_host_header_to_sni: - description: - - If sni server name is specified, rewrite incoming host header to the sni server name. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - server_auto_scale: - description: - - Server autoscale. - - Not used anymore. - - Field deprecated in 18.1.2. - type: bool - server_count: - description: - - Field deprecated in 18.2.1. - server_name: - description: - - Fully qualified dns hostname which will be used in the tls sni extension in server connections if sni is enabled. - - If no value is specified, avi will use the incoming host header instead. - server_reselect: - description: - - Server reselect configuration for http requests. - server_timeout: - description: - - Server timeout value specifies the time within which a server connection needs to be established and a request-response exchange completes - - between avi and the server. - - Value of 0 results in using default timeout of 60 minutes. - - Allowed values are 0-3600000. - - Field introduced in 18.1.5,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - servers: - description: - - The pool directs load balanced traffic to this list of destination servers. - - The servers can be configured by ip address, name, network or via ip address group. - service_metadata: - description: - - Metadata pertaining to the service provided by this pool. - - In openshift/kubernetes environments, app metadata info is stored. - - Any user input to this field will be overwritten by avi vantage. - - Field introduced in 17.2.14,18.1.5,18.2.1. - sni_enabled: - description: - - Enable tls sni for server connections. - - If disabled, avi will not send the sni extension as part of the handshake. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - ssl_key_and_certificate_ref: - description: - - Service engines will present a client ssl certificate to the server. - - It is a reference to an object of type sslkeyandcertificate. - ssl_profile_ref: - description: - - When enabled, avi re-encrypts traffic to the backend servers. - - The specific ssl profile defines which ciphers and ssl versions will be supported. - - It is a reference to an object of type sslprofile. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - use_service_port: - description: - - Do not translate the client's destination port when sending the connection to the server. - - The pool or servers specified service port will still be used for health monitoring. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - uuid: - description: - - Uuid of the pool. - vrf_ref: - description: - - Virtual routing context that the pool is bound to. - - This is used to provide the isolation of the set of networks the pool is attached to. - - The pool inherits the virtual routing context of the virtual service, and this field is used only internally, and is set by pb-transform. - - It is a reference to an object of type vrfcontext. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Create a Pool with two servers and HTTP monitor - community.network.avi_pool: - controller: 10.10.1.20 - username: avi_user - password: avi_password - name: testpool1 - description: testpool1 - state: present - health_monitor_refs: - - '/api/healthmonitor?name=System-HTTP' - servers: - - ip: - addr: 10.10.2.20 - type: V4 - - ip: - addr: 10.10.2.21 - type: V4 - -- name: Patch pool with a single server using patch op and avi_credentials - community.network.avi_pool: - avi_api_update_method: patch - avi_api_patch_op: delete - avi_credentials: "{{avi_credentials}}" - name: test-pool - servers: - - ip: - addr: 10.90.64.13 - type: 'V4' - register: pool - when: - - state | default("present") == "present" -""" - -RETURN = ''' -obj: - description: Pool (api/pool) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - a_pool=dict(type='str',), - ab_pool=dict(type='dict',), - ab_priority=dict(type='int',), - analytics_policy=dict(type='dict',), - analytics_profile_ref=dict(type='str',), - apic_epg_name=dict(type='str',), - application_persistence_profile_ref=dict(type='str',), - autoscale_launch_config_ref=dict(type='str',), - autoscale_networks=dict(type='list',), - autoscale_policy_ref=dict(type='str',), - capacity_estimation=dict(type='bool',), - capacity_estimation_ttfb_thresh=dict(type='int',), - cloud_config_cksum=dict(type='str',), - cloud_ref=dict(type='str',), - conn_pool_properties=dict(type='dict',), - connection_ramp_duration=dict(type='int',), - created_by=dict(type='str',), - default_server_port=dict(type='int',), - delete_server_on_dns_refresh=dict(type='bool',), - description=dict(type='str',), - domain_name=dict(type='list',), - east_west=dict(type='bool',), - enabled=dict(type='bool',), - external_autoscale_groups=dict(type='list',), - fail_action=dict(type='dict',), - fewest_tasks_feedback_delay=dict(type='int',), - graceful_disable_timeout=dict(type='int',), - gslb_sp_enabled=dict(type='bool',), - health_monitor_refs=dict(type='list',), - host_check_enabled=dict(type='bool',), - inline_health_monitor=dict(type='bool',), - ipaddrgroup_ref=dict(type='str',), - lb_algorithm=dict(type='str',), - lb_algorithm_consistent_hash_hdr=dict(type='str',), - lb_algorithm_core_nonaffinity=dict(type='int',), - lb_algorithm_hash=dict(type='str',), - lookup_server_by_name=dict(type='bool',), - max_concurrent_connections_per_server=dict(type='int',), - max_conn_rate_per_server=dict(type='dict',), - min_health_monitors_up=dict(type='int',), - min_servers_up=dict(type='int',), - name=dict(type='str', required=True), - networks=dict(type='list',), - nsx_securitygroup=dict(type='list',), - pki_profile_ref=dict(type='str',), - placement_networks=dict(type='list',), - prst_hdr_name=dict(type='str',), - request_queue_depth=dict(type='int',), - request_queue_enabled=dict(type='bool',), - rewrite_host_header_to_server_name=dict(type='bool',), - rewrite_host_header_to_sni=dict(type='bool',), - server_auto_scale=dict(type='bool',), - server_count=dict(type='int',), - server_name=dict(type='str',), - server_reselect=dict(type='dict',), - server_timeout=dict(type='int',), - servers=dict(type='list',), - service_metadata=dict(type='str',), - sni_enabled=dict(type='bool',), - ssl_key_and_certificate_ref=dict(type='str', no_log=False), - ssl_profile_ref=dict(type='str',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - use_service_port=dict(type='bool',), - uuid=dict(type='str',), - vrf_ref=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'pool', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_poolgroup.py b/plugins/modules/network/avi/avi_poolgroup.py deleted file mode 100644 index c66269dd..00000000 --- a/plugins/modules/network/avi/avi_poolgroup.py +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_poolgroup -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of PoolGroup Avi RESTful Object -description: - - This module is used to configure PoolGroup object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cloud_config_cksum: - description: - - Checksum of cloud configuration for poolgroup. - - Internally set by cloud connector. - cloud_ref: - description: - - It is a reference to an object of type cloud. - created_by: - description: - - Name of the user who created the object. - deployment_policy_ref: - description: - - When setup autoscale manager will automatically promote new pools into production when deployment goals are met. - - It is a reference to an object of type poolgroupdeploymentpolicy. - description: - description: - - Description of pool group. - fail_action: - description: - - Enable an action - close connection, http redirect, or local http response - when a pool group failure happens. - - By default, a connection will be closed, in case the pool group experiences a failure. - implicit_priority_labels: - description: - - Whether an implicit set of priority labels is generated. - - Field introduced in 17.1.9,17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - members: - description: - - List of pool group members object of type poolgroupmember. - min_servers: - description: - - The minimum number of servers to distribute traffic to. - - Allowed values are 1-65535. - - Special values are 0 - 'disable'. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - name: - description: - - The name of the pool group. - required: true - priority_labels_ref: - description: - - Uuid of the priority labels. - - If not provided, pool group member priority label will be interpreted as a number with a larger number considered higher priority. - - It is a reference to an object of type prioritylabels. - service_metadata: - description: - - Metadata pertaining to the service provided by this poolgroup. - - In openshift/kubernetes environments, app metadata info is stored. - - Any user input to this field will be overwritten by avi vantage. - - Field introduced in 17.2.14,18.1.5,18.2.1. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the pool group. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create PoolGroup object - community.network.avi_poolgroup: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_poolgroup -""" - -RETURN = ''' -obj: - description: PoolGroup (api/poolgroup) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cloud_config_cksum=dict(type='str',), - cloud_ref=dict(type='str',), - created_by=dict(type='str',), - deployment_policy_ref=dict(type='str',), - description=dict(type='str',), - fail_action=dict(type='dict',), - implicit_priority_labels=dict(type='bool',), - members=dict(type='list',), - min_servers=dict(type='int',), - name=dict(type='str', required=True), - priority_labels_ref=dict(type='str',), - service_metadata=dict(type='str',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'poolgroup', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py b/plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py deleted file mode 100644 index 952de35a..00000000 --- a/plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_poolgroupdeploymentpolicy -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of PoolGroupDeploymentPolicy Avi RESTful Object -description: - - This module is used to configure PoolGroupDeploymentPolicy object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - auto_disable_old_prod_pools: - description: - - It will automatically disable old production pools once there is a new production candidate. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - description: - description: - - User defined description for the object. - evaluation_duration: - description: - - Duration of evaluation period for automatic deployment. - - Allowed values are 60-86400. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - name: - description: - - The name of the pool group deployment policy. - required: true - rules: - description: - - List of pgdeploymentrule. - scheme: - description: - - Deployment scheme. - - Enum options - BLUE_GREEN, CANARY. - - Default value when not specified in API or module is interpreted by Avi Controller as BLUE_GREEN. - target_test_traffic_ratio: - description: - - Target traffic ratio before pool is made production. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 100. - tenant_ref: - description: - - It is a reference to an object of type tenant. - test_traffic_ratio_rampup: - description: - - Ratio of the traffic that is sent to the pool under test. - - Test ratio of 100 means blue green. - - Allowed values are 1-100. - - Default value when not specified in API or module is interpreted by Avi Controller as 100. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the pool group deployment policy. - webhook_ref: - description: - - Webhook configured with url that avi controller will pass back information about pool group, old and new pool information and current deployment - - rule results. - - It is a reference to an object of type webhook. - - Field introduced in 17.1.1. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create PoolGroupDeploymentPolicy object - community.network.avi_poolgroupdeploymentpolicy: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_poolgroupdeploymentpolicy -""" - -RETURN = ''' -obj: - description: PoolGroupDeploymentPolicy (api/poolgroupdeploymentpolicy) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - auto_disable_old_prod_pools=dict(type='bool',), - description=dict(type='str',), - evaluation_duration=dict(type='int',), - name=dict(type='str', required=True), - rules=dict(type='list',), - scheme=dict(type='str',), - target_test_traffic_ratio=dict(type='int',), - tenant_ref=dict(type='str',), - test_traffic_ratio_rampup=dict(type='int',), - url=dict(type='str',), - uuid=dict(type='str',), - webhook_ref=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'poolgroupdeploymentpolicy', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_prioritylabels.py b/plugins/modules/network/avi/avi_prioritylabels.py deleted file mode 100644 index fc8c38ec..00000000 --- a/plugins/modules/network/avi/avi_prioritylabels.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_prioritylabels -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of PriorityLabels Avi RESTful Object -description: - - This module is used to configure PriorityLabels object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cloud_ref: - description: - - It is a reference to an object of type cloud. - description: - description: - - A description of the priority labels. - equivalent_labels: - description: - - Equivalent priority labels in descending order. - name: - description: - - The name of the priority labels. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the priority labels. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create PriorityLabels object - community.network.avi_prioritylabels: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_prioritylabels -""" - -RETURN = ''' -obj: - description: PriorityLabels (api/prioritylabels) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cloud_ref=dict(type='str',), - description=dict(type='str',), - equivalent_labels=dict(type='list',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'prioritylabels', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_role.py b/plugins/modules/network/avi/avi_role.py deleted file mode 100644 index fc71de19..00000000 --- a/plugins/modules/network/avi/avi_role.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_role -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Role Avi RESTful Object -description: - - This module is used to configure Role object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - name: - description: - - Name of the object. - required: true - privileges: - description: - - List of permission. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create Role object - community.network.avi_role: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_role -""" - -RETURN = ''' -obj: - description: Role (api/role) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - name=dict(type='str', required=True), - privileges=dict(type='list',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'role', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_scheduler.py b/plugins/modules/network/avi/avi_scheduler.py deleted file mode 100644 index ef3cabb1..00000000 --- a/plugins/modules/network/avi/avi_scheduler.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_scheduler -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Scheduler Avi RESTful Object -description: - - This module is used to configure Scheduler object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - backup_config_ref: - description: - - Backup configuration to be executed by this scheduler. - - It is a reference to an object of type backupconfiguration. - enabled: - description: - - Boolean flag to set enabled. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - end_date_time: - description: - - Scheduler end date and time. - frequency: - description: - - Frequency at which custom scheduler will run. - - Allowed values are 0-60. - frequency_unit: - description: - - Unit at which custom scheduler will run. - - Enum options - SCHEDULER_FREQUENCY_UNIT_MIN, SCHEDULER_FREQUENCY_UNIT_HOUR, SCHEDULER_FREQUENCY_UNIT_DAY, SCHEDULER_FREQUENCY_UNIT_WEEK, - - SCHEDULER_FREQUENCY_UNIT_MONTH. - name: - description: - - Name of scheduler. - required: true - run_mode: - description: - - Scheduler run mode. - - Enum options - RUN_MODE_PERIODIC, RUN_MODE_AT, RUN_MODE_NOW. - run_script_ref: - description: - - Control script to be executed by this scheduler. - - It is a reference to an object of type alertscriptconfig. - scheduler_action: - description: - - Define scheduler action. - - Enum options - SCHEDULER_ACTION_RUN_A_SCRIPT, SCHEDULER_ACTION_BACKUP. - - Default value when not specified in API or module is interpreted by Avi Controller as SCHEDULER_ACTION_BACKUP. - start_date_time: - description: - - Scheduler start date and time. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create Scheduler object - community.network.avi_scheduler: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_scheduler -""" - -RETURN = ''' -obj: - description: Scheduler (api/scheduler) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - backup_config_ref=dict(type='str',), - enabled=dict(type='bool',), - end_date_time=dict(type='str',), - frequency=dict(type='int',), - frequency_unit=dict(type='str',), - name=dict(type='str', required=True), - run_mode=dict(type='str',), - run_script_ref=dict(type='str',), - scheduler_action=dict(type='str',), - start_date_time=dict(type='str',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'scheduler', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_seproperties.py b/plugins/modules/network/avi/avi_seproperties.py deleted file mode 100644 index 3150cafb..00000000 --- a/plugins/modules/network/avi/avi_seproperties.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_seproperties -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of SeProperties Avi RESTful Object -description: - - This module is used to configure SeProperties object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - se_agent_properties: - description: - - Seagentproperties settings for seproperties. - se_bootup_properties: - description: - - Sebootupproperties settings for seproperties. - se_runtime_properties: - description: - - Seruntimeproperties settings for seproperties. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. - - Default value when not specified in API or module is interpreted by Avi Controller as default. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create SeProperties object - community.network.avi_seproperties: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_seproperties -""" - -RETURN = ''' -obj: - description: SeProperties (api/seproperties) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - se_agent_properties=dict(type='dict',), - se_bootup_properties=dict(type='dict',), - se_runtime_properties=dict(type='dict',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'seproperties', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_serverautoscalepolicy.py b/plugins/modules/network/avi/avi_serverautoscalepolicy.py deleted file mode 100644 index 0f97a1bb..00000000 --- a/plugins/modules/network/avi/avi_serverautoscalepolicy.py +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_serverautoscalepolicy -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ServerAutoScalePolicy Avi RESTful Object -description: - - This module is used to configure ServerAutoScalePolicy object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - description: - description: - - User defined description for the object. - intelligent_autoscale: - description: - - Use avi intelligent autoscale algorithm where autoscale is performed by comparing load on the pool against estimated capacity of all the servers. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - intelligent_scalein_margin: - description: - - Maximum extra capacity as percentage of load used by the intelligent scheme. - - Scalein is triggered when available capacity is more than this margin. - - Allowed values are 1-99. - - Default value when not specified in API or module is interpreted by Avi Controller as 40. - intelligent_scaleout_margin: - description: - - Minimum extra capacity as percentage of load used by the intelligent scheme. - - Scaleout is triggered when available capacity is less than this margin. - - Allowed values are 1-99. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - max_scalein_adjustment_step: - description: - - Maximum number of servers to scalein simultaneously. - - The actual number of servers to scalein is chosen such that target number of servers is always more than or equal to the min_size. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - max_scaleout_adjustment_step: - description: - - Maximum number of servers to scaleout simultaneously. - - The actual number of servers to scaleout is chosen such that target number of servers is always less than or equal to the max_size. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - max_size: - description: - - Maximum number of servers after scaleout. - - Allowed values are 0-400. - min_size: - description: - - No scale-in happens once number of operationally up servers reach min_servers. - - Allowed values are 0-400. - name: - description: - - Name of the object. - required: true - scalein_alertconfig_refs: - description: - - Trigger scalein when alerts due to any of these alert configurations are raised. - - It is a reference to an object of type alertconfig. - scalein_cooldown: - description: - - Cooldown period during which no new scalein is triggered to allow previous scalein to successfully complete. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - scaleout_alertconfig_refs: - description: - - Trigger scaleout when alerts due to any of these alert configurations are raised. - - It is a reference to an object of type alertconfig. - scaleout_cooldown: - description: - - Cooldown period during which no new scaleout is triggered to allow previous scaleout to successfully complete. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - use_predicted_load: - description: - - Use predicted load rather than current load. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ServerAutoScalePolicy object - community.network.avi_serverautoscalepolicy: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_serverautoscalepolicy -""" - -RETURN = ''' -obj: - description: ServerAutoScalePolicy (api/serverautoscalepolicy) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - description=dict(type='str',), - intelligent_autoscale=dict(type='bool',), - intelligent_scalein_margin=dict(type='int',), - intelligent_scaleout_margin=dict(type='int',), - max_scalein_adjustment_step=dict(type='int',), - max_scaleout_adjustment_step=dict(type='int',), - max_size=dict(type='int',), - min_size=dict(type='int',), - name=dict(type='str', required=True), - scalein_alertconfig_refs=dict(type='list',), - scalein_cooldown=dict(type='int',), - scaleout_alertconfig_refs=dict(type='list',), - scaleout_cooldown=dict(type='int',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - use_predicted_load=dict(type='bool',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'serverautoscalepolicy', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_serviceengine.py b/plugins/modules/network/avi/avi_serviceengine.py deleted file mode 100644 index c1e54725..00000000 --- a/plugins/modules/network/avi/avi_serviceengine.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_serviceengine -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ServiceEngine Avi RESTful Object -description: - - This module is used to configure ServiceEngine object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - availability_zone: - description: - - Availability_zone of serviceengine. - cloud_ref: - description: - - It is a reference to an object of type cloud. - container_mode: - description: - - Boolean flag to set container_mode. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - container_type: - description: - - Enum options - container_type_bridge, container_type_host, container_type_host_dpdk. - - Default value when not specified in API or module is interpreted by Avi Controller as CONTAINER_TYPE_HOST. - controller_created: - description: - - Boolean flag to set controller_created. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - controller_ip: - description: - - Controller_ip of serviceengine. - data_vnics: - description: - - List of vnic. - enable_state: - description: - - Inorder to disable se set this field appropriately. - - Enum options - SE_STATE_ENABLED, SE_STATE_DISABLED_FOR_PLACEMENT, SE_STATE_DISABLED, SE_STATE_DISABLED_FORCE. - - Default value when not specified in API or module is interpreted by Avi Controller as SE_STATE_ENABLED. - flavor: - description: - - Flavor of serviceengine. - host_ref: - description: - - It is a reference to an object of type vimgrhostruntime. - hypervisor: - description: - - Enum options - default, vmware_esx, kvm, vmware_vsan, xen. - mgmt_vnic: - description: - - Vnic settings for serviceengine. - name: - description: - - Name of the object. - - Default value when not specified in API or module is interpreted by Avi Controller as VM name unknown. - resources: - description: - - Seresources settings for serviceengine. - se_group_ref: - description: - - It is a reference to an object of type serviceenginegroup. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ServiceEngine object - community.network.avi_serviceengine: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_serviceengine -""" - -RETURN = ''' -obj: - description: ServiceEngine (api/serviceengine) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - availability_zone=dict(type='str',), - cloud_ref=dict(type='str',), - container_mode=dict(type='bool',), - container_type=dict(type='str',), - controller_created=dict(type='bool',), - controller_ip=dict(type='str',), - data_vnics=dict(type='list',), - enable_state=dict(type='str',), - flavor=dict(type='str',), - host_ref=dict(type='str',), - hypervisor=dict(type='str',), - mgmt_vnic=dict(type='dict',), - name=dict(type='str',), - resources=dict(type='dict',), - se_group_ref=dict(type='str',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'serviceengine', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_serviceenginegroup.py b/plugins/modules/network/avi/avi_serviceenginegroup.py deleted file mode 100644 index cbf59478..00000000 --- a/plugins/modules/network/avi/avi_serviceenginegroup.py +++ /dev/null @@ -1,1075 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_serviceenginegroup -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of ServiceEngineGroup Avi RESTful Object -description: - - This module is used to configure ServiceEngineGroup object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - accelerated_networking: - description: - - Enable accelerated networking option for azure se. - - Accelerated networking enables single root i/o virtualization (sr-iov) to a se vm. - - This improves networking performance. - - Field introduced in 17.2.14,18.1.5,18.2.1. - type: bool - active_standby: - description: - - Service engines in active/standby mode for ha failover. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - additional_config_memory: - description: - - Indicates the percent of config memory used for config updates. - - Allowed values are 0-90. - - Field deprecated in 18.1.2. - - Field introduced in 18.1.1. - advertise_backend_networks: - description: - - Advertise reach-ability of backend server networks via adc through bgp for default gateway feature. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - aggressive_failure_detection: - description: - - Enable aggressive failover configuration for ha. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - algo: - description: - - In compact placement, virtual services are placed on existing ses until max_vs_per_se limit is reached. - - Enum options - PLACEMENT_ALGO_PACKED, PLACEMENT_ALGO_DISTRIBUTED. - - Default value when not specified in API or module is interpreted by Avi Controller as PLACEMENT_ALGO_PACKED. - allow_burst: - description: - - Allow ses to be created using burst license. - - Field introduced in 17.2.5. - type: bool - app_cache_percent: - description: - - A percent value of total se memory reserved for application caching. - - This is an se bootup property and requires se restart. - - Allowed values are 0 - 100. - - Special values are 0- 'disable'. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - app_learning_memory_percent: - description: - - A percent value of total se memory reserved for application learning. - - This is an se bootup property and requires se restart. - - Allowed values are 0 - 10. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - archive_shm_limit: - description: - - Amount of se memory in gb until which shared memory is collected in core archive. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 8. - async_ssl: - description: - - Ssl handshakes will be handled by dedicated ssl threads. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - async_ssl_threads: - description: - - Number of async ssl threads per se_dp. - - Allowed values are 1-16. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - auto_rebalance: - description: - - If set, virtual services will be automatically migrated when load on an se is less than minimum or more than maximum thresholds. - - Only alerts are generated when the auto_rebalance is not set. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - auto_rebalance_capacity_per_se: - description: - - Capacities of se for auto rebalance for each criteria. - - Field introduced in 17.2.4. - auto_rebalance_criteria: - description: - - Set of criteria for se auto rebalance. - - Enum options - SE_AUTO_REBALANCE_CPU, SE_AUTO_REBALANCE_PPS, SE_AUTO_REBALANCE_MBPS, SE_AUTO_REBALANCE_OPEN_CONNS, SE_AUTO_REBALANCE_CPS. - - Field introduced in 17.2.3. - auto_rebalance_interval: - description: - - Frequency of rebalance, if 'auto rebalance' is enabled. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - auto_redistribute_active_standby_load: - description: - - Redistribution of virtual services from the takeover se to the replacement se can cause momentary traffic loss. - - If the auto-redistribute load option is left in its default off state, any desired rebalancing requires calls to rest api. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - bgp_state_update_interval: - description: - - Bgp peer state update interval. - - Allowed values are 5-100. - - Field introduced in 17.2.14,18.1.5,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - buffer_se: - description: - - Excess service engine capacity provisioned for ha failover. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - cloud_ref: - description: - - It is a reference to an object of type cloud. - config_debugs_on_all_cores: - description: - - Enable config debugs on all cores of se. - - Field introduced in 17.2.13,18.1.5,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - connection_memory_percentage: - description: - - Percentage of memory for connection state. - - This will come at the expense of memory used for http in-memory cache. - - Allowed values are 10-90. - - Default value when not specified in API or module is interpreted by Avi Controller as 50. - cpu_reserve: - description: - - Boolean flag to set cpu_reserve. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - cpu_socket_affinity: - description: - - Allocate all the cpu cores for the service engine virtual machines on the same cpu socket. - - Applicable only for vcenter cloud. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - custom_securitygroups_data: - description: - - Custom security groups to be associated with data vnics for se instances in openstack and aws clouds. - - Field introduced in 17.1.3. - custom_securitygroups_mgmt: - description: - - Custom security groups to be associated with management vnic for se instances in openstack and aws clouds. - - Field introduced in 17.1.3. - custom_tag: - description: - - Custom tag will be used to create the tags for se instance in aws. - - Note this is not the same as the prefix for se name. - data_network_id: - description: - - Subnet used to spin up the data nic for service engines, used only for azure cloud. - - Overrides the cloud level setting for service engine subnet. - - Field introduced in 18.2.3. - datascript_timeout: - description: - - Number of instructions before datascript times out. - - Allowed values are 0-100000000. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 1000000. - dedicated_dispatcher_core: - description: - - Dedicate the core that handles packet receive/transmit from the network to just the dispatching function. - - Don't use it for tcp/ip and ssl functions. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - description: - description: - - User defined description for the object. - disable_avi_securitygroups: - description: - - By default, avi creates and manages security groups along with custom sg provided by user. - - Set this to true to disallow avi to create and manage new security groups. - - Avi will only make use of custom security groups provided by user. - - This option is only supported for aws cloud type. - - Field introduced in 17.2.13,18.1.4,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - disable_csum_offloads: - description: - - Stop using tcp/udp and ip checksum offload features of nics. - - Field introduced in 17.1.14, 17.2.5, 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - disable_gro: - description: - - Disable generic receive offload (gro) in dpdk poll-mode driver packet receive path. - - Gro is on by default on nics that do not support lro (large receive offload) or do not gain performance boost from lro. - - Field introduced in 17.2.5, 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - disable_se_memory_check: - description: - - If set, disable the config memory check done in service engine. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - disable_tso: - description: - - Disable tcp segmentation offload (tso) in dpdk poll-mode driver packet transmit path. - - Tso is on by default on nics that support it. - - Field introduced in 17.2.5, 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - disk_per_se: - description: - - Amount of disk space for each of the service engine virtual machines. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - distribute_load_active_standby: - description: - - Use both the active and standby service engines for virtual service placement in the legacy active standby ha mode. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - distribute_queues: - description: - - Distributes queue ownership among cores so multiple cores handle dispatcher duties. - - Field introduced in 17.2.8. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - enable_hsm_priming: - description: - - (this is a beta feature). - - Enable hsm key priming. - - If enabled, key handles on the hsm will be synced to se before processing client connections. - - Field introduced in 17.2.7, 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - enable_multi_lb: - description: - - Applicable only for azure cloud with basic sku lb. - - If set, additional azure lbs will be automatically created if resources in existing lb are exhausted. - - Field introduced in 17.2.10, 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - enable_routing: - description: - - Enable routing for this serviceenginegroup . - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - enable_vip_on_all_interfaces: - description: - - Enable vip on all interfaces of se. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - enable_vmac: - description: - - Use virtual mac address for interfaces on which floating interface ips are placed. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - ephemeral_portrange_end: - description: - - End local ephemeral port number for outbound connections. - - Field introduced in 17.2.13, 18.1.5, 18.2.1. - ephemeral_portrange_start: - description: - - Start local ephemeral port number for outbound connections. - - Field introduced in 17.2.13, 18.1.5, 18.2.1. - extra_config_multiplier: - description: - - Multiplier for extra config to support large vs/pool config. - - Default value when not specified in API or module is interpreted by Avi Controller as 0.0. - extra_shared_config_memory: - description: - - Extra config memory to support large geo db configuration. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - floating_intf_ip: - description: - - If serviceenginegroup is configured for legacy 1+1 active standby ha mode, floating ip's will be advertised only by the active se in the pair. - - Virtual services in this group must be disabled/enabled for any changes to the floating ip's to take effect. - - Only active se hosting vs tagged with active standby se 1 tag will advertise this floating ip when manual load distribution is enabled. - floating_intf_ip_se_2: - description: - - If serviceenginegroup is configured for legacy 1+1 active standby ha mode, floating ip's will be advertised only by the active se in the pair. - - Virtual services in this group must be disabled/enabled for any changes to the floating ip's to take effect. - - Only active se hosting vs tagged with active standby se 2 tag will advertise this floating ip when manual load distribution is enabled. - flow_table_new_syn_max_entries: - description: - - Maximum number of flow table entries that have not completed tcp three-way handshake yet. - - Field introduced in 17.2.5. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - free_list_size: - description: - - Number of entries in the free list. - - Field introduced in 17.2.10, 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 1024. - ha_mode: - description: - - High availability mode for all the virtual services using this service engine group. - - Enum options - HA_MODE_SHARED_PAIR, HA_MODE_SHARED, HA_MODE_LEGACY_ACTIVE_STANDBY. - - Default value when not specified in API or module is interpreted by Avi Controller as HA_MODE_SHARED. - hardwaresecuritymodulegroup_ref: - description: - - It is a reference to an object of type hardwaresecuritymodulegroup. - heap_minimum_config_memory: - description: - - Minimum required heap memory to apply any configuration. - - Allowed values are 0-100. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 8. - hm_on_standby: - description: - - Enable active health monitoring from the standby se for all placed virtual services. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - host_attribute_key: - description: - - Key of a (key, value) pair identifying a label for a set of nodes usually in container clouds. - - Needs to be specified together with host_attribute_value. - - Ses can be configured differently including ha modes across different se groups. - - May also be used for isolation between different classes of virtualservices. - - Virtualservices' se group may be specified via annotations/labels. - - A openshift/kubernetes namespace maybe annotated with a matching se group label as openshift.io/node-selector apptype=prod. - - When multiple se groups are used in a cloud with host attributes specified,just a single se group can exist as a match-all se group without a - - host_attribute_key. - host_attribute_value: - description: - - Value of a (key, value) pair identifying a label for a set of nodes usually in container clouds. - - Needs to be specified together with host_attribute_key. - host_gateway_monitor: - description: - - Enable the host gateway monitor when service engine is deployed as docker container. - - Disabled by default. - - Field introduced in 17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - hypervisor: - description: - - Override default hypervisor. - - Enum options - DEFAULT, VMWARE_ESX, KVM, VMWARE_VSAN, XEN. - ignore_rtt_threshold: - description: - - Ignore rtt samples if it is above threshold. - - Field introduced in 17.1.6,17.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 5000. - ingress_access_data: - description: - - Program se security group ingress rules to allow vip data access from remote cidr type. - - Enum options - SG_INGRESS_ACCESS_NONE, SG_INGRESS_ACCESS_ALL, SG_INGRESS_ACCESS_VPC. - - Field introduced in 17.1.5. - - Default value when not specified in API or module is interpreted by Avi Controller as SG_INGRESS_ACCESS_ALL. - ingress_access_mgmt: - description: - - Program se security group ingress rules to allow ssh/icmp management access from remote cidr type. - - Enum options - SG_INGRESS_ACCESS_NONE, SG_INGRESS_ACCESS_ALL, SG_INGRESS_ACCESS_VPC. - - Field introduced in 17.1.5. - - Default value when not specified in API or module is interpreted by Avi Controller as SG_INGRESS_ACCESS_ALL. - instance_flavor: - description: - - Instance/flavor name for se instance. - iptables: - description: - - Iptables rules. - least_load_core_selection: - description: - - Select core with least load for new flow. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - license_tier: - description: - - Specifies the license tier which would be used. - - This field by default inherits the value from cloud. - - Enum options - ENTERPRISE_16, ENTERPRISE_18. - - Field introduced in 17.2.5. - license_type: - description: - - If no license type is specified then default license enforcement for the cloud type is chosen. - - Enum options - LIC_BACKEND_SERVERS, LIC_SOCKETS, LIC_CORES, LIC_HOSTS, LIC_SE_BANDWIDTH, LIC_METERED_SE_BANDWIDTH. - - Field introduced in 17.2.5. - log_disksz: - description: - - Maximum disk capacity (in mb) to be allocated to an se. - - This is exclusively used for debug and log data. - - Default value when not specified in API or module is interpreted by Avi Controller as 10000. - max_cpu_usage: - description: - - When cpu usage on an se exceeds this threshold, virtual services hosted on this se may be rebalanced to other ses to reduce load. - - A new se may be created as part of this process. - - Allowed values are 40-90. - - Default value when not specified in API or module is interpreted by Avi Controller as 80. - max_memory_per_mempool: - description: - - Max bytes that can be allocated in a single mempool. - - Field introduced in 18.1.5. - - Default value when not specified in API or module is interpreted by Avi Controller as 64. - max_public_ips_per_lb: - description: - - Applicable to azure platform only. - - Maximum number of public ips per azure lb. - - Field introduced in 17.2.12, 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 30. - max_rules_per_lb: - description: - - Applicable to azure platform only. - - Maximum number of rules per azure lb. - - Field introduced in 17.2.12, 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 150. - max_scaleout_per_vs: - description: - - Maximum number of active service engines for the virtual service. - - Allowed values are 1-64. - - Default value when not specified in API or module is interpreted by Avi Controller as 4. - max_se: - description: - - Maximum number of services engines in this group. - - Allowed values are 0-1000. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - max_vs_per_se: - description: - - Maximum number of virtual services that can be placed on a single service engine. - - East west virtual services are excluded from this limit. - - Allowed values are 1-1000. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - mem_reserve: - description: - - Boolean flag to set mem_reserve. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - memory_for_config_update: - description: - - Indicates the percent of memory reserved for config updates. - - Allowed values are 0-100. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 15. - memory_per_se: - description: - - Amount of memory for each of the service engine virtual machines. - - Default value when not specified in API or module is interpreted by Avi Controller as 2048. - mgmt_network_ref: - description: - - Management network to use for avi service engines. - - It is a reference to an object of type network. - mgmt_subnet: - description: - - Management subnet to use for avi service engines. - min_cpu_usage: - description: - - When cpu usage on an se falls below the minimum threshold, virtual services hosted on the se may be consolidated onto other underutilized ses. - - After consolidation, unused service engines may then be eligible for deletion. - - Allowed values are 20-60. - - Default value when not specified in API or module is interpreted by Avi Controller as 30. - min_scaleout_per_vs: - description: - - Minimum number of active service engines for the virtual service. - - Allowed values are 1-64. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - min_se: - description: - - Minimum number of services engines in this group (relevant for se autorebalance only). - - Allowed values are 0-1000. - - Field introduced in 17.2.13,18.1.3,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - minimum_connection_memory: - description: - - Indicates the percent of memory reserved for connections. - - Allowed values are 0-100. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 20. - minimum_required_config_memory: - description: - - Required available config memory to apply any configuration. - - Allowed values are 0-90. - - Field deprecated in 18.1.2. - - Field introduced in 18.1.1. - n_log_streaming_threads: - description: - - Number of threads to use for log streaming. - - Allowed values are 1-100. - - Field introduced in 17.2.12, 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - name: - description: - - Name of the object. - required: true - non_significant_log_throttle: - description: - - This setting limits the number of non-significant logs generated per second per core on this se. - - Default is 100 logs per second. - - Set it to zero (0) to disable throttling. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 100. - num_dispatcher_cores: - description: - - Number of dispatcher cores (0,1,2,4,8 or 16). - - If set to 0, then number of dispatcher cores is deduced automatically. - - Allowed values are 0,1,2,4,8,16. - - Field introduced in 17.2.12, 18.1.3, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - num_flow_cores_sum_changes_to_ignore: - description: - - Number of changes in num flow cores sum to ignore. - - Default value when not specified in API or module is interpreted by Avi Controller as 8. - openstack_availability_zone: - description: - - Field deprecated in 17.1.1. - openstack_availability_zones: - description: - - Field introduced in 17.1.1. - openstack_mgmt_network_name: - description: - - Avi management network name. - openstack_mgmt_network_uuid: - description: - - Management network uuid. - os_reserved_memory: - description: - - Amount of extra memory to be reserved for use by the operating system on a service engine. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - per_app: - description: - - Per-app se mode is designed for deploying dedicated load balancers per app (vs). - - In this mode, each se is limited to a max of 2 vss. - - Vcpus in per-app ses count towards licensing usage at 25% rate. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - placement_mode: - description: - - If placement mode is 'auto', virtual services are automatically placed on service engines. - - Enum options - PLACEMENT_MODE_AUTO. - - Default value when not specified in API or module is interpreted by Avi Controller as PLACEMENT_MODE_AUTO. - realtime_se_metrics: - description: - - Enable or disable real time se metrics. - reboot_on_stop: - description: - - Reboot the system if the se is stopped. - - Field introduced in 17.2.16,18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - se_bandwidth_type: - description: - - Select the se bandwidth for the bandwidth license. - - Enum options - SE_BANDWIDTH_UNLIMITED, SE_BANDWIDTH_25M, SE_BANDWIDTH_200M, SE_BANDWIDTH_1000M, SE_BANDWIDTH_10000M. - - Field introduced in 17.2.5. - se_deprovision_delay: - description: - - Duration to preserve unused service engine virtual machines before deleting them. - - If traffic to a virtual service were to spike up abruptly, this se would still be available to be utilized again rather than creating a new se. - - If this value is set to 0, controller will never delete any ses and administrator has to manually cleanup unused ses. - - Allowed values are 0-525600. - - Default value when not specified in API or module is interpreted by Avi Controller as 120. - se_dos_profile: - description: - - Dosthresholdprofile settings for serviceenginegroup. - se_dpdk_pmd: - description: - - Determines if dpdk pool mode driver should be used or not 0 automatically determine based on hypervisor/nic type 1 unconditionally use dpdk - - poll mode driver 2 don't use dpdk poll mode driver. - - Allowed values are 0-2. - - Field introduced in 18.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - se_flow_probe_retries: - description: - - Flow probe retry count if no replies are received. - - Allowed values are 0-5. - - Field introduced in 18.1.4, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 2. - se_flow_probe_timer: - description: - - Timeout in milliseconds for flow probe entries. - - Allowed values are 10-200. - - Field introduced in 18.1.4, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 100. - se_ipc_udp_port: - description: - - Udp port for se_dp ipc in docker bridge mode. - - Field introduced in 17.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 1500. - se_name_prefix: - description: - - Prefix to use for virtual machine name of service engines. - - Default value when not specified in API or module is interpreted by Avi Controller as Avi. - se_pcap_lookahead: - description: - - Enables lookahead mode of packet receive in pcap mode. - - Introduced to overcome an issue with hv_netvsc driver. - - Lookahead mode attempts to ensure that application and kernel's view of the receive rings are consistent. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - se_pcap_reinit_frequency: - description: - - Frequency in seconds at which periodically a pcap reinit check is triggered. - - May be used in conjunction with the configuration pcap_reinit_threshold. - - (valid range 15 mins - 12 hours, 0 - disables). - - Allowed values are 900-43200. - - Special values are 0- 'disable'. - - Field introduced in 17.2.13, 18.1.3, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - se_pcap_reinit_threshold: - description: - - Threshold for input packet receive errors in pcap mode exceeding which a pcap reinit is triggered. - - If not set, an unconditional reinit is performed. - - This value is checked every pcap_reinit_frequency interval. - - Field introduced in 17.2.13, 18.1.3, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - se_probe_port: - description: - - Tcp port on se where echo service will be run. - - Field introduced in 17.2.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 7. - se_remote_punt_udp_port: - description: - - Udp port for punted packets in docker bridge mode. - - Field introduced in 17.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 1501. - se_routing: - description: - - Enable routing via service engine datapath. - - When disabled, routing is done by the linux kernel. - - Ip routing needs to be enabled in service engine group for se routing to be effective. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - se_sb_dedicated_core: - description: - - Sideband traffic will be handled by a dedicated core. - - Field introduced in 16.5.2, 17.1.9, 17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - se_sb_threads: - description: - - Number of sideband threads per se. - - Allowed values are 1-128. - - Field introduced in 16.5.2, 17.1.9, 17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - se_thread_multiplier: - description: - - Multiplier for se threads based on vcpu. - - Allowed values are 1-10. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - se_tracert_port_range: - description: - - Traceroute port range. - - Field introduced in 17.2.8. - se_tunnel_mode: - description: - - Determines if dsr from secondary se is active or not 0 automatically determine based on hypervisor type. - - 1 disable dsr unconditionally. - - 2 enable dsr unconditionally. - - Allowed values are 0-2. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - se_tunnel_udp_port: - description: - - Udp port for tunneled packets from secondary to primary se in docker bridge mode. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 1550. - se_udp_encap_ipc: - description: - - Determines if se-se ipc messages are encapsulated in a udp header 0 automatically determine based on hypervisor type. - - 1 use udp encap unconditionally. - - Allowed values are 0-1. - - Field introduced in 17.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - se_use_dpdk: - description: - - Determines if dpdk library should be used or not 0 automatically determine based on hypervisor type 1 use dpdk if pcap is not enabled 2 - - don't use dpdk. - - Allowed values are 0-2. - - Field introduced in 18.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - se_vs_hb_max_pkts_in_batch: - description: - - Maximum number of aggregated vs heartbeat packets to send in a batch. - - Allowed values are 1-256. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 64. - se_vs_hb_max_vs_in_pkt: - description: - - Maximum number of virtualservices for which heartbeat messages are aggregated in one packet. - - Allowed values are 1-1024. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 256. - self_se_election: - description: - - Enable ses to elect a primary amongst themselves in the absence of a connectivity to controller. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - service_ip6_subnets: - description: - - Ipv6 subnets assigned to the se group. - - Required for vs group placement. - - Field introduced in 18.1.1. - service_ip_subnets: - description: - - Subnets assigned to the se group. - - Required for vs group placement. - - Field introduced in 17.1.1. - shm_minimum_config_memory: - description: - - Minimum required shared memory to apply any configuration. - - Allowed values are 0-100. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 4. - significant_log_throttle: - description: - - This setting limits the number of significant logs generated per second per core on this se. - - Default is 100 logs per second. - - Set it to zero (0) to disable throttling. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 100. - ssl_preprocess_sni_hostname: - description: - - (beta) preprocess ssl client hello for sni hostname extension.if set to true, this will apply sni child's ssl protocol(s), if they are different - - from sni parent's allowed ssl protocol(s). - - Field introduced in 17.2.12, 18.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - tenant_ref: - description: - - It is a reference to an object of type tenant. - udf_log_throttle: - description: - - This setting limits the number of udf logs generated per second per core on this se. - - Udf logs are generated due to the configured client log filters or the rules with logging enabled. - - Default is 100 logs per second. - - Set it to zero (0) to disable throttling. - - Field introduced in 17.1.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 100. - url: - description: - - Avi controller URL of the object. - use_standard_alb: - description: - - Use standard sku azure load balancer. - - By default cloud level flag is set. - - If not set, it inherits/uses the use_standard_alb flag from the cloud. - - Field introduced in 18.2.3. - type: bool - uuid: - description: - - Unique object identifier of the object. - vcenter_clusters: - description: - - Vcenterclusters settings for serviceenginegroup. - vcenter_datastore_mode: - description: - - Enum options - vcenter_datastore_any, vcenter_datastore_local, vcenter_datastore_shared. - - Default value when not specified in API or module is interpreted by Avi Controller as VCENTER_DATASTORE_ANY. - vcenter_datastores: - description: - - List of vcenterdatastore. - vcenter_datastores_include: - description: - - Boolean flag to set vcenter_datastores_include. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - vcenter_folder: - description: - - Folder to place all the service engine virtual machines in vcenter. - - Default value when not specified in API or module is interpreted by Avi Controller as AviSeFolder. - vcenter_hosts: - description: - - Vcenterhosts settings for serviceenginegroup. - vcpus_per_se: - description: - - Number of vcpus for each of the service engine virtual machines. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. - vip_asg: - description: - - When vip_asg is set, vip configuration will be managed by avi.user will be able to configure vip_asg or vips individually at the time of create. - - Field introduced in 17.2.12, 18.1.2. - vs_host_redundancy: - description: - - Ensure primary and secondary service engines are deployed on different physical hosts. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - vs_scalein_timeout: - description: - - Time to wait for the scaled in se to drain existing flows before marking the scalein done. - - Default value when not specified in API or module is interpreted by Avi Controller as 30. - vs_scalein_timeout_for_upgrade: - description: - - During se upgrade, time to wait for the scaled-in se to drain existing flows before marking the scalein done. - - Default value when not specified in API or module is interpreted by Avi Controller as 30. - vs_scaleout_timeout: - description: - - Time to wait for the scaled out se to become ready before marking the scaleout done. - - Default value when not specified in API or module is interpreted by Avi Controller as 600. - vs_se_scaleout_additional_wait_time: - description: - - Wait time for sending scaleout ready notification after virtual service is marked up. - - In certain deployments, there may be an additional delay to accept traffic. - - For example, for bgp, some time is needed for route advertisement. - - Allowed values are 0-20. - - Field introduced in 18.1.5,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - vs_se_scaleout_ready_timeout: - description: - - Timeout in seconds for service engine to sendscaleout ready notification of a virtual service. - - Allowed values are 0-60. - - Field introduced in 18.1.5,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 25. - vs_switchover_timeout: - description: - - During se upgrade in a legacy active/standby segroup, time to wait for the new primary se to accept flows before marking the switchover done. - - Field introduced in 17.2.13,18.1.4,18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as 300. - vss_placement: - description: - - Parameters to place virtual services on only a subset of the cores of an se. - - Field introduced in 17.2.5. - vss_placement_enabled: - description: - - If set, virtual services will be placed on only a subset of the cores of an se. - - Field introduced in 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - waf_learning_interval: - description: - - Frequency with which se publishes waf learning. - - Allowed values are 1-43200. - - Field deprecated in 18.2.3. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 10. - waf_learning_memory: - description: - - Amount of memory reserved on se for waf learning. - - Cannot exceed 5% of se memory. - - Field deprecated in 18.2.3. - - Field introduced in 18.1.2. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - waf_mempool: - description: - - Enable memory pool for waf. - - Field introduced in 17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - waf_mempool_size: - description: - - Memory pool size used for waf. - - Field introduced in 17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as 64. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create ServiceEngineGroup object - community.network.avi_serviceenginegroup: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_serviceenginegroup -""" - -RETURN = ''' -obj: - description: ServiceEngineGroup (api/serviceenginegroup) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - accelerated_networking=dict(type='bool',), - active_standby=dict(type='bool',), - additional_config_memory=dict(type='int',), - advertise_backend_networks=dict(type='bool',), - aggressive_failure_detection=dict(type='bool',), - algo=dict(type='str',), - allow_burst=dict(type='bool',), - app_cache_percent=dict(type='int',), - app_learning_memory_percent=dict(type='int',), - archive_shm_limit=dict(type='int',), - async_ssl=dict(type='bool',), - async_ssl_threads=dict(type='int',), - auto_rebalance=dict(type='bool',), - auto_rebalance_capacity_per_se=dict(type='list',), - auto_rebalance_criteria=dict(type='list',), - auto_rebalance_interval=dict(type='int',), - auto_redistribute_active_standby_load=dict(type='bool',), - bgp_state_update_interval=dict(type='int',), - buffer_se=dict(type='int',), - cloud_ref=dict(type='str',), - config_debugs_on_all_cores=dict(type='bool',), - connection_memory_percentage=dict(type='int',), - cpu_reserve=dict(type='bool',), - cpu_socket_affinity=dict(type='bool',), - custom_securitygroups_data=dict(type='list',), - custom_securitygroups_mgmt=dict(type='list',), - custom_tag=dict(type='list',), - data_network_id=dict(type='str',), - datascript_timeout=dict(type='int',), - dedicated_dispatcher_core=dict(type='bool',), - description=dict(type='str',), - disable_avi_securitygroups=dict(type='bool',), - disable_csum_offloads=dict(type='bool',), - disable_gro=dict(type='bool',), - disable_se_memory_check=dict(type='bool',), - disable_tso=dict(type='bool',), - disk_per_se=dict(type='int',), - distribute_load_active_standby=dict(type='bool',), - distribute_queues=dict(type='bool',), - enable_hsm_priming=dict(type='bool',), - enable_multi_lb=dict(type='bool',), - enable_routing=dict(type='bool',), - enable_vip_on_all_interfaces=dict(type='bool',), - enable_vmac=dict(type='bool',), - ephemeral_portrange_end=dict(type='int',), - ephemeral_portrange_start=dict(type='int',), - extra_config_multiplier=dict(type='float',), - extra_shared_config_memory=dict(type='int',), - floating_intf_ip=dict(type='list',), - floating_intf_ip_se_2=dict(type='list',), - flow_table_new_syn_max_entries=dict(type='int',), - free_list_size=dict(type='int',), - ha_mode=dict(type='str',), - hardwaresecuritymodulegroup_ref=dict(type='str',), - heap_minimum_config_memory=dict(type='int',), - hm_on_standby=dict(type='bool',), - host_attribute_key=dict(type='str', no_log=False), - host_attribute_value=dict(type='str',), - host_gateway_monitor=dict(type='bool',), - hypervisor=dict(type='str',), - ignore_rtt_threshold=dict(type='int',), - ingress_access_data=dict(type='str',), - ingress_access_mgmt=dict(type='str',), - instance_flavor=dict(type='str',), - iptables=dict(type='list',), - least_load_core_selection=dict(type='bool',), - license_tier=dict(type='str',), - license_type=dict(type='str',), - log_disksz=dict(type='int',), - max_cpu_usage=dict(type='int',), - max_memory_per_mempool=dict(type='int',), - max_public_ips_per_lb=dict(type='int',), - max_rules_per_lb=dict(type='int',), - max_scaleout_per_vs=dict(type='int',), - max_se=dict(type='int',), - max_vs_per_se=dict(type='int',), - mem_reserve=dict(type='bool',), - memory_for_config_update=dict(type='int',), - memory_per_se=dict(type='int',), - mgmt_network_ref=dict(type='str',), - mgmt_subnet=dict(type='dict',), - min_cpu_usage=dict(type='int',), - min_scaleout_per_vs=dict(type='int',), - min_se=dict(type='int',), - minimum_connection_memory=dict(type='int',), - minimum_required_config_memory=dict(type='int',), - n_log_streaming_threads=dict(type='int',), - name=dict(type='str', required=True), - non_significant_log_throttle=dict(type='int',), - num_dispatcher_cores=dict(type='int',), - num_flow_cores_sum_changes_to_ignore=dict(type='int',), - openstack_availability_zone=dict(type='str',), - openstack_availability_zones=dict(type='list',), - openstack_mgmt_network_name=dict(type='str',), - openstack_mgmt_network_uuid=dict(type='str',), - os_reserved_memory=dict(type='int',), - per_app=dict(type='bool',), - placement_mode=dict(type='str',), - realtime_se_metrics=dict(type='dict',), - reboot_on_stop=dict(type='bool',), - se_bandwidth_type=dict(type='str',), - se_deprovision_delay=dict(type='int',), - se_dos_profile=dict(type='dict',), - se_dpdk_pmd=dict(type='int',), - se_flow_probe_retries=dict(type='int',), - se_flow_probe_timer=dict(type='int',), - se_ipc_udp_port=dict(type='int',), - se_name_prefix=dict(type='str',), - se_pcap_lookahead=dict(type='bool',), - se_pcap_reinit_frequency=dict(type='int',), - se_pcap_reinit_threshold=dict(type='int',), - se_probe_port=dict(type='int',), - se_remote_punt_udp_port=dict(type='int',), - se_routing=dict(type='bool',), - se_sb_dedicated_core=dict(type='bool',), - se_sb_threads=dict(type='int',), - se_thread_multiplier=dict(type='int',), - se_tracert_port_range=dict(type='dict',), - se_tunnel_mode=dict(type='int',), - se_tunnel_udp_port=dict(type='int',), - se_udp_encap_ipc=dict(type='int',), - se_use_dpdk=dict(type='int',), - se_vs_hb_max_pkts_in_batch=dict(type='int',), - se_vs_hb_max_vs_in_pkt=dict(type='int',), - self_se_election=dict(type='bool',), - service_ip6_subnets=dict(type='list',), - service_ip_subnets=dict(type='list',), - shm_minimum_config_memory=dict(type='int',), - significant_log_throttle=dict(type='int',), - ssl_preprocess_sni_hostname=dict(type='bool',), - tenant_ref=dict(type='str',), - udf_log_throttle=dict(type='int',), - url=dict(type='str',), - use_standard_alb=dict(type='bool',), - uuid=dict(type='str',), - vcenter_clusters=dict(type='dict',), - vcenter_datastore_mode=dict(type='str',), - vcenter_datastores=dict(type='list',), - vcenter_datastores_include=dict(type='bool',), - vcenter_folder=dict(type='str',), - vcenter_hosts=dict(type='dict',), - vcpus_per_se=dict(type='int',), - vip_asg=dict(type='dict',), - vs_host_redundancy=dict(type='bool',), - vs_scalein_timeout=dict(type='int',), - vs_scalein_timeout_for_upgrade=dict(type='int',), - vs_scaleout_timeout=dict(type='int',), - vs_se_scaleout_additional_wait_time=dict(type='int',), - vs_se_scaleout_ready_timeout=dict(type='int',), - vs_switchover_timeout=dict(type='int',), - vss_placement=dict(type='dict',), - vss_placement_enabled=dict(type='bool',), - waf_learning_interval=dict(type='int',), - waf_learning_memory=dict(type='int',), - waf_mempool=dict(type='bool',), - waf_mempool_size=dict(type='int',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'serviceenginegroup', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_snmptrapprofile.py b/plugins/modules/network/avi/avi_snmptrapprofile.py deleted file mode 100644 index d8dec87d..00000000 --- a/plugins/modules/network/avi/avi_snmptrapprofile.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_snmptrapprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of SnmpTrapProfile Avi RESTful Object -description: - - This module is used to configure SnmpTrapProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - name: - description: - - A user-friendly name of the snmp trap configuration. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - trap_servers: - description: - - The ip address or hostname of the snmp trap destination server. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the snmp trap profile object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create SnmpTrapProfile object - community.network.avi_snmptrapprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_snmptrapprofile -""" - -RETURN = ''' -obj: - description: SnmpTrapProfile (api/snmptrapprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - trap_servers=dict(type='list',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'snmptrapprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_sslkeyandcertificate.py b/plugins/modules/network/avi/avi_sslkeyandcertificate.py deleted file mode 100644 index 9d85b7fa..00000000 --- a/plugins/modules/network/avi/avi_sslkeyandcertificate.py +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_sslkeyandcertificate -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of SSLKeyAndCertificate Avi RESTful Object -description: - - This module is used to configure SSLKeyAndCertificate object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - ca_certs: - description: - - Ca certificates in certificate chain. - certificate: - description: - - Sslcertificate settings for sslkeyandcertificate. - required: true - certificate_base64: - description: - - States if the certificate is base64 encoded. - - Field introduced in 18.1.2, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - certificate_management_profile_ref: - description: - - It is a reference to an object of type certificatemanagementprofile. - created_by: - description: - - Creator name. - dynamic_params: - description: - - Dynamic parameters needed for certificate management profile. - enckey_base64: - description: - - Encrypted private key corresponding to the private key (e.g. - - Those generated by an hsm such as thales nshield). - enckey_name: - description: - - Name of the encrypted private key (e.g. - - Those generated by an hsm such as thales nshield). - format: - description: - - Format of the key/certificate file. - - Enum options - SSL_PEM, SSL_PKCS12. - - Field introduced in 18.1.2, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as SSL_PEM. - hardwaresecuritymodulegroup_ref: - description: - - It is a reference to an object of type hardwaresecuritymodulegroup. - key: - description: - - Private key. - key_base64: - description: - - States if the private key is base64 encoded. - - Field introduced in 18.1.2, 18.2.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - key_params: - description: - - Sslkeyparams settings for sslkeyandcertificate. - key_passphrase: - description: - - Passphrase used to encrypt the private key. - - Field introduced in 18.1.2, 18.2.1. - name: - description: - - Name of the object. - required: true - status: - description: - - Enum options - ssl_certificate_finished, ssl_certificate_pending. - - Default value when not specified in API or module is interpreted by Avi Controller as SSL_CERTIFICATE_FINISHED. - tenant_ref: - description: - - It is a reference to an object of type tenant. - type: - description: - - Enum options - ssl_certificate_type_virtualservice, ssl_certificate_type_system, ssl_certificate_type_ca. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Create a SSL Key and Certificate - community.network.avi_sslkeyandcertificate: - controller: 10.10.27.90 - username: admin - password: AviNetworks123! - key: | - -----BEGIN PRIVATE KEY----- - .... - -----END PRIVATE KEY----- - certificate: - self_signed: true - certificate: | - -----BEGIN CERTIFICATE----- - .... - -----END CERTIFICATE----- - type: SSL_CERTIFICATE_TYPE_VIRTUALSERVICE - name: MyTestCert -""" - -RETURN = ''' -obj: - description: SSLKeyAndCertificate (api/sslkeyandcertificate) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - ca_certs=dict(type='list',), - certificate=dict(type='dict', required=True), - certificate_base64=dict(type='bool',), - certificate_management_profile_ref=dict(type='str',), - created_by=dict(type='str',), - dynamic_params=dict(type='list',), - enckey_base64=dict(type='str', no_log=True), - enckey_name=dict(type='str',), - format=dict(type='str',), - hardwaresecuritymodulegroup_ref=dict(type='str',), - key=dict(type='str', no_log=True,), - key_base64=dict(type='bool',), - key_params=dict(type='dict', no_log=False), - key_passphrase=dict(type='str', no_log=True,), - name=dict(type='str', required=True), - status=dict(type='str',), - tenant_ref=dict(type='str',), - type=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'sslkeyandcertificate', - set(['key_passphrase', 'key'])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_sslprofile.py b/plugins/modules/network/avi/avi_sslprofile.py deleted file mode 100644 index c98fbf14..00000000 --- a/plugins/modules/network/avi/avi_sslprofile.py +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_sslprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of SSLProfile Avi RESTful Object -description: - - This module is used to configure SSLProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - accepted_ciphers: - description: - - Ciphers suites represented as defined by U(http://www.openssl.org/docs/apps/ciphers.html). - - Default value when not specified in API or module is interpreted by Avi Controller as AES:3DES:RC4. - accepted_versions: - description: - - Set of versions accepted by the server. - cipher_enums: - description: - - Enum options - tls_ecdhe_ecdsa_with_aes_128_gcm_sha256, tls_ecdhe_ecdsa_with_aes_256_gcm_sha384, tls_ecdhe_rsa_with_aes_128_gcm_sha256, - - tls_ecdhe_rsa_with_aes_256_gcm_sha384, tls_ecdhe_ecdsa_with_aes_128_cbc_sha256, tls_ecdhe_ecdsa_with_aes_256_cbc_sha384, - - tls_ecdhe_rsa_with_aes_128_cbc_sha256, tls_ecdhe_rsa_with_aes_256_cbc_sha384, tls_rsa_with_aes_128_gcm_sha256, tls_rsa_with_aes_256_gcm_sha384, - - tls_rsa_with_aes_128_cbc_sha256, tls_rsa_with_aes_256_cbc_sha256, tls_ecdhe_ecdsa_with_aes_128_cbc_sha, tls_ecdhe_ecdsa_with_aes_256_cbc_sha, - - tls_ecdhe_rsa_with_aes_128_cbc_sha, tls_ecdhe_rsa_with_aes_256_cbc_sha, tls_rsa_with_aes_128_cbc_sha, tls_rsa_with_aes_256_cbc_sha, - - tls_rsa_with_3des_ede_cbc_sha, tls_rsa_with_rc4_128_sha. - description: - description: - - User defined description for the object. - dhparam: - description: - - Dh parameters used in ssl. - - At this time, it is not configurable and is set to 2048 bits. - enable_ssl_session_reuse: - description: - - Enable ssl session re-use. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - name: - description: - - Name of the object. - required: true - prefer_client_cipher_ordering: - description: - - Prefer the ssl cipher ordering presented by the client during the ssl handshake over the one specified in the ssl profile. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - send_close_notify: - description: - - Send 'close notify' alert message for a clean shutdown of the ssl connection. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - ssl_rating: - description: - - Sslrating settings for sslprofile. - ssl_session_timeout: - description: - - The amount of time in seconds before an ssl session expires. - - Default value when not specified in API or module is interpreted by Avi Controller as 86400. - tags: - description: - - List of tag. - tenant_ref: - description: - - It is a reference to an object of type tenant. - type: - description: - - Ssl profile type. - - Enum options - SSL_PROFILE_TYPE_APPLICATION, SSL_PROFILE_TYPE_SYSTEM. - - Field introduced in 17.2.8. - - Default value when not specified in API or module is interpreted by Avi Controller as SSL_PROFILE_TYPE_APPLICATION. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create SSL profile with list of allowed ciphers - community.network.avi_sslprofile: - controller: '{{ controller }}' - username: '{{ username }}' - password: '{{ password }}' - accepted_ciphers: > - ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA: - ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384: - AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA: - AES256-SHA:DES-CBC3-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384: - ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA - accepted_versions: - - type: SSL_VERSION_TLS1 - - type: SSL_VERSION_TLS1_1 - - type: SSL_VERSION_TLS1_2 - cipher_enums: - - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - - TLS_RSA_WITH_AES_128_GCM_SHA256 - - TLS_RSA_WITH_AES_256_GCM_SHA384 - - TLS_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_256_CBC_SHA256 - - TLS_RSA_WITH_AES_128_CBC_SHA - - TLS_RSA_WITH_AES_256_CBC_SHA - - TLS_RSA_WITH_3DES_EDE_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - name: PFS-BOTH-RSA-EC - send_close_notify: true - ssl_rating: - compatibility_rating: SSL_SCORE_EXCELLENT - performance_rating: SSL_SCORE_EXCELLENT - security_score: '100.0' - tenant_ref: Demo -""" - -RETURN = ''' -obj: - description: SSLProfile (api/sslprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - accepted_ciphers=dict(type='str',), - accepted_versions=dict(type='list',), - cipher_enums=dict(type='list',), - description=dict(type='str',), - dhparam=dict(type='str',), - enable_ssl_session_reuse=dict(type='bool',), - name=dict(type='str', required=True), - prefer_client_cipher_ordering=dict(type='bool',), - send_close_notify=dict(type='bool',), - ssl_rating=dict(type='dict',), - ssl_session_timeout=dict(type='int',), - tags=dict(type='list',), - tenant_ref=dict(type='str',), - type=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'sslprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_stringgroup.py b/plugins/modules/network/avi/avi_stringgroup.py deleted file mode 100644 index d88ed4d9..00000000 --- a/plugins/modules/network/avi/avi_stringgroup.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_stringgroup -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of StringGroup Avi RESTful Object -description: - - This module is used to configure StringGroup object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - description: - description: - - User defined description for the object. - kv: - description: - - Configure key value in the string group. - name: - description: - - Name of the string group. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - type: - description: - - Type of stringgroup. - - Enum options - SG_TYPE_STRING, SG_TYPE_KEYVAL. - - Default value when not specified in API or module is interpreted by Avi Controller as SG_TYPE_STRING. - required: true - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the string group. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create a string group configuration - community.network.avi_stringgroup: - controller: '{{ controller }}' - password: '{{ password }}' - username: '{{ username }}' - kv: - - key: text/html - - key: text/xml - - key: text/plain - - key: text/css - - key: text/javascript - - key: application/javascript - - key: application/x-javascript - - key: application/xml - - key: application/pdf - name: System-Compressible-Content-Types - tenant_ref: admin - type: SG_TYPE_STRING -""" - -RETURN = ''' -obj: - description: StringGroup (api/stringgroup) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - description=dict(type='str',), - kv=dict(type='list',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - type=dict(type='str', required=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'stringgroup', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_systemconfiguration.py b/plugins/modules/network/avi/avi_systemconfiguration.py deleted file mode 100644 index e44ac67c..00000000 --- a/plugins/modules/network/avi/avi_systemconfiguration.py +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_systemconfiguration -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of SystemConfiguration Avi RESTful Object -description: - - This module is used to configure SystemConfiguration object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - admin_auth_configuration: - description: - - Adminauthconfiguration settings for systemconfiguration. - default_license_tier: - description: - - Specifies the default license tier which would be used by new clouds. - - Enum options - ENTERPRISE_16, ENTERPRISE_18. - - Field introduced in 17.2.5. - - Default value when not specified in API or module is interpreted by Avi Controller as ENTERPRISE_18. - dns_configuration: - description: - - Dnsconfiguration settings for systemconfiguration. - dns_virtualservice_refs: - description: - - Dns virtualservices hosting fqdn records for applications across avi vantage. - - If no virtualservices are provided, avi vantage will provide dns services for configured applications. - - Switching back to avi vantage from dns virtualservices is not allowed. - - It is a reference to an object of type virtualservice. - docker_mode: - description: - - Boolean flag to set docker_mode. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - email_configuration: - description: - - Emailconfiguration settings for systemconfiguration. - global_tenant_config: - description: - - Tenantconfiguration settings for systemconfiguration. - linux_configuration: - description: - - Linuxconfiguration settings for systemconfiguration. - mgmt_ip_access_control: - description: - - Configure ip access control for controller to restrict open access. - ntp_configuration: - description: - - Ntpconfiguration settings for systemconfiguration. - portal_configuration: - description: - - Portalconfiguration settings for systemconfiguration. - proxy_configuration: - description: - - Proxyconfiguration settings for systemconfiguration. - secure_channel_configuration: - description: - - Configure secure channel properties. - - Field introduced in 18.1.4, 18.2.1. - snmp_configuration: - description: - - Snmpconfiguration settings for systemconfiguration. - ssh_ciphers: - description: - - Allowed ciphers list for ssh to the management interface on the controller and service engines. - - If this is not specified, all the default ciphers are allowed. - ssh_hmacs: - description: - - Allowed hmac list for ssh to the management interface on the controller and service engines. - - If this is not specified, all the default hmacs are allowed. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. - welcome_workflow_complete: - description: - - This flag is set once the initial controller setup workflow is complete. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create SystemConfiguration object - community.network.avi_systemconfiguration: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_systemconfiguration -""" - -RETURN = ''' -obj: - description: SystemConfiguration (api/systemconfiguration) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - admin_auth_configuration=dict(type='dict',), - default_license_tier=dict(type='str',), - dns_configuration=dict(type='dict',), - dns_virtualservice_refs=dict(type='list',), - docker_mode=dict(type='bool',), - email_configuration=dict(type='dict',), - global_tenant_config=dict(type='dict',), - linux_configuration=dict(type='dict',), - mgmt_ip_access_control=dict(type='dict',), - ntp_configuration=dict(type='dict',), - portal_configuration=dict(type='dict',), - proxy_configuration=dict(type='dict',), - secure_channel_configuration=dict(type='dict',), - snmp_configuration=dict(type='dict',), - ssh_ciphers=dict(type='list',), - ssh_hmacs=dict(type='list',), - url=dict(type='str',), - uuid=dict(type='str',), - welcome_workflow_complete=dict(type='bool',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'systemconfiguration', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_tenant.py b/plugins/modules/network/avi/avi_tenant.py deleted file mode 100644 index d3c12088..00000000 --- a/plugins/modules/network/avi/avi_tenant.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_tenant -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Tenant Avi RESTful Object -description: - - This module is used to configure Tenant object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - config_settings: - description: - - Tenantconfiguration settings for tenant. - created_by: - description: - - Creator of this tenant. - description: - description: - - User defined description for the object. - local: - description: - - Boolean flag to set local. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - name: - description: - - Name of the object. - required: true - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ - - name: Create Tenant using Service Engines in provider mode - community.network.avi_tenant: - controller: '{{ controller }}' - password: '{{ password }}' - username: '{{ username }}' - config_settings: - se_in_provider_context: false - tenant_access_to_provider_se: true - tenant_vrf: false - description: VCenter, Open Stack, AWS Virtual services - local: true - name: Demo -""" - -RETURN = ''' -obj: - description: Tenant (api/tenant) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - config_settings=dict(type='dict',), - created_by=dict(type='str',), - description=dict(type='str',), - local=dict(type='bool',), - name=dict(type='str', required=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'tenant', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_trafficcloneprofile.py b/plugins/modules/network/avi/avi_trafficcloneprofile.py deleted file mode 100644 index 406ccc6b..00000000 --- a/plugins/modules/network/avi/avi_trafficcloneprofile.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_trafficcloneprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of TrafficCloneProfile Avi RESTful Object -description: - - This module is used to configure TrafficCloneProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - clone_servers: - description: - - Field introduced in 17.1.1. - cloud_ref: - description: - - It is a reference to an object of type cloud. - - Field introduced in 17.1.1. - name: - description: - - Name for the traffic clone profile. - - Field introduced in 17.1.1. - required: true - preserve_client_ip: - description: - - Specifies if client ip needs to be preserved to clone destination. - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.1.1. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the traffic clone profile. - - Field introduced in 17.1.1. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create TrafficCloneProfile object - community.network.avi_trafficcloneprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_trafficcloneprofile -""" - -RETURN = ''' -obj: - description: TrafficCloneProfile (api/trafficcloneprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - clone_servers=dict(type='list',), - cloud_ref=dict(type='str',), - name=dict(type='str', required=True), - preserve_client_ip=dict(type='bool',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'trafficcloneprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_user.py b/plugins/modules/network/avi/avi_user.py deleted file mode 100644 index fb55695d..00000000 --- a/plugins/modules/network/avi/avi_user.py +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/python -""" -# Created on Aug 2, 2018 -# -# @author: Shrikant Chaudhari (shrikant.chaudhari@avinetworks.com) GitHub ID: gitshrikant -# -# module_check: supported -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# -""" - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_user -author: Shrikant Chaudhari (@gitshrikant) -short_description: Avi User Module -description: - - This module can be used for creation, updation and deletion of a user. -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: present - choices: ["absent", "present"] - type: str - name: - description: - - Full name of the user. - required: true - type: str - obj_username: - description: - - Name that the user will supply when signing into Avi Vantage, such as jdoe or jdoe@avinetworks.com. - required: true - type: str - obj_password: - description: - - You may either enter a case-sensitive password in this field for the new or existing user. - required: true - type: str - email: - description: - - Email address of the user. This field is used when a user loses their password and requests to have it reset. See Password Recovery. - type: str - access: - description: - - Access settings (write, read, or no access) for each type of resource within Vantage. - type: list - is_superuser: - description: - - If the user will need to have the same privileges as the admin account, set it to true. - type: bool - is_active: - description: - - Activates the current user account. - type: bool - avi_api_update_method: - description: - - Default method for object update is HTTP PUT. - - Setting to patch will override that behavior to use HTTP PATCH. - default: put - choices: ["post", "put", "patch"] - type: str - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - type: str - user_profile_ref: - description: - - Refer user profile. - - This can also be full URI same as it comes in response payload - type: str - default_tenant_ref: - description: - - Default tenant reference. - - This can also be full URI same as it comes in response payload - default: /api/tenant?name=admin - type: str - - -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = ''' - - name: User creation - community.network.avi_user: - controller: "" - username: "" - password: "" - api_version: "" - name: "testuser" - obj_username: "testuser" - obj_password: "test123" - email: "test@abc.test" - access: - - role_ref: "/api/role?name=Tenant-Admin" - tenant_ref: "/api/tenant/admin#admin" - user_profile_ref: "/api/useraccountprofile?name=Default-User-Account-Profile" - is_active: true - is_superuser: true - default_tenant_ref: "/api/tenant?name=admin" - - - name: User creation - community.network.avi_user: - controller: "" - username: "" - password: "" - api_version: "" - name: "testuser" - obj_username: "testuser2" - obj_password: "password" - email: "testuser2@abc.test" - access: - - role_ref: "https://192.0.2.10/api/role?name=Tenant-Admin" - tenant_ref: "https://192.0.2.10/api/tenant/admin#admin" - user_profile_ref: "https://192.0.2.10/api/useraccountprofile?name=Default-User-Account-Profile" - is_active: true - is_superuser: true - default_tenant_ref: "https://192.0.2.10/api/tenant?name=admin" -''' - -RETURN = ''' -obj: - description: Avi REST resource - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule - -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, ansible_return, HAS_AVI) - from ansible_collections.community.network.plugins.module_utils.network.avi.ansible_utils import ( - avi_ansible_api) -except ImportError: - HAS_AVI = False - - -def main(): - argument_specs = dict( - state=dict(default='present', - choices=['absent', 'present']), - name=dict(type='str', required=True), - obj_username=dict(type='str', required=True), - obj_password=dict(type='str', required=True, no_log=True), - access=dict(type='list',), - email=dict(type='str',), - is_superuser=dict(type='bool',), - is_active=dict(type='bool',), - avi_api_update_method=dict(default='put', - choices=['post', 'put', 'patch']), - avi_api_patch_op=dict(choices=['add', 'replace', 'delete']), - user_profile_ref=dict(type='str',), - default_tenant_ref=dict(type='str', default='/api/tenant?name=admin'), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule(argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'user', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_useraccount.py b/plugins/modules/network/avi/avi_useraccount.py deleted file mode 100644 index 9d3f4c2f..00000000 --- a/plugins/modules/network/avi/avi_useraccount.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/python -""" -# Created on Aug 12, 2016 -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 -# -# module_check: not supported -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# -""" - - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_useraccount -author: Chaitanya Deshpande (@chaitanyaavi) -short_description: Avi UserAccount Module -description: - - This module can be used for updating the password of a user. - - This module is useful for setting up admin password for Controller bootstrap. -requirements: [ avisdk ] -options: - old_password: - description: - - Old password for update password or default password for bootstrap. - force_change: - description: - - If specifically set to true then old password is tried first for controller and then the new password is - tried. If not specified this flag then the new password is tried first. - default: false - -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = ''' - - name: Update user password - community.network.avi_useraccount: - controller: "" - username: "" - password: new_password - old_password: "" - api_version: "" - force_change: false - - - name: Update user password using avi_credentials - community.network.avi_useraccount: - avi_credentials: "" - old_password: "" - force_change: false -''' - -RETURN = ''' -obj: - description: Avi REST resource - returned: success, changed - type: dict -''' - -import json -import time -from ansible.module_utils.basic import AnsibleModule -from copy import deepcopy - -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, ansible_return, avi_obj_cmp, - cleanup_absent_fields, HAS_AVI) - from ansible_collections.community.network.plugins.module_utils.network.avi.avi_api import ( - ApiSession, AviCredentials) -except ImportError: - HAS_AVI = False - - -def main(): - argument_specs = dict( - old_password=dict(type='str', required=True, no_log=True), - # Flag to specify priority of old/new password while establishing session with controller. - # To handle both Saas and conventional (Entire state in playbook) scenario. - force_change=dict(type='bool', default=False) - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule(argument_spec=argument_specs) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - api_creds = AviCredentials() - api_creds.update_from_ansible_module(module) - old_password = module.params.get('old_password') - force_change = module.params.get('force_change', False) - data = { - 'old_password': old_password, - 'password': api_creds.password - } - # First try old password if 'force_change' is set to true - if force_change: - first_pwd = old_password - second_pwd = api_creds.password - # First try new password if 'force_change' is set to false or not specified in playbook. - else: - first_pwd = api_creds.password - second_pwd = old_password - password_changed = False - try: - api = ApiSession.get_session( - api_creds.controller, api_creds.username, - password=first_pwd, timeout=api_creds.timeout, - tenant=api_creds.tenant, tenant_uuid=api_creds.tenant_uuid, - token=api_creds.token, port=api_creds.port) - if force_change: - rsp = api.put('useraccount', data=data) - if rsp: - password_changed = True - except Exception: - pass - if not password_changed: - api = ApiSession.get_session( - api_creds.controller, api_creds.username, password=second_pwd, - timeout=api_creds.timeout, tenant=api_creds.tenant, - tenant_uuid=api_creds.tenant_uuid, token=api_creds.token, - port=api_creds.port) - if not force_change: - rsp = api.put('useraccount', data=data) - if rsp: - password_changed = True - if password_changed: - return ansible_return(module, rsp, True, req=data) - else: - return ansible_return(module, rsp, False, req=data) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_useraccountprofile.py b/plugins/modules/network/avi/avi_useraccountprofile.py deleted file mode 100644 index d098aff0..00000000 --- a/plugins/modules/network/avi/avi_useraccountprofile.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_useraccountprofile -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of UserAccountProfile Avi RESTful Object -description: - - This module is used to configure UserAccountProfile object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - account_lock_timeout: - description: - - Lock timeout period (in minutes). - - Default is 30 minutes. - - Default value when not specified in API or module is interpreted by Avi Controller as 30. - credentials_timeout_threshold: - description: - - The time period after which credentials expire. - - Default is 180 days. - - Default value when not specified in API or module is interpreted by Avi Controller as 180. - max_concurrent_sessions: - description: - - Maximum number of concurrent sessions allowed. - - There are unlimited sessions by default. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - max_login_failure_count: - description: - - Number of login attempts before lockout. - - Default is 3 attempts. - - Default value when not specified in API or module is interpreted by Avi Controller as 3. - max_password_history_count: - description: - - Maximum number of passwords to be maintained in the password history. - - Default is 4 passwords. - - Default value when not specified in API or module is interpreted by Avi Controller as 4. - name: - description: - - Name of the object. - required: true - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create UserAccountProfile object - community.network.avi_useraccountprofile: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_useraccountprofile -""" - -RETURN = ''' -obj: - description: UserAccountProfile (api/useraccountprofile) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - account_lock_timeout=dict(type='int',), - credentials_timeout_threshold=dict(type='int',), - max_concurrent_sessions=dict(type='int',), - max_login_failure_count=dict(type='int',), - max_password_history_count=dict(type='int',), - name=dict(type='str', required=True), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'useraccountprofile', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_virtualservice.py b/plugins/modules/network/avi/avi_virtualservice.py deleted file mode 100644 index c39a8b7c..00000000 --- a/plugins/modules/network/avi/avi_virtualservice.py +++ /dev/null @@ -1,652 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_virtualservice -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of VirtualService Avi RESTful Object -description: - - This module is used to configure VirtualService object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - active_standby_se_tag: - description: - - This configuration only applies if the virtualservice is in legacy active standby ha mode and load distribution among active standby is enabled. - - This field is used to tag the virtualservice so that virtualservices with the same tag will share the same active serviceengine. - - Virtualservices with different tags will have different active serviceengines. - - If one of the serviceengine's in the serviceenginegroup fails, all virtualservices will end up using the same active serviceengine. - - Redistribution of the virtualservices can be either manual or automated when the failed serviceengine recovers. - - Redistribution is based on the auto redistribute property of the serviceenginegroup. - - Enum options - ACTIVE_STANDBY_SE_1, ACTIVE_STANDBY_SE_2. - - Default value when not specified in API or module is interpreted by Avi Controller as ACTIVE_STANDBY_SE_1. - allow_invalid_client_cert: - description: - - Process request even if invalid client certificate is presented. - - Datascript apis need to be used for processing of such requests. - - Field introduced in 18.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - analytics_policy: - description: - - Determines analytics settings for the application. - analytics_profile_ref: - description: - - Specifies settings related to analytics. - - It is a reference to an object of type analyticsprofile. - apic_contract_graph: - description: - - The name of the contract/graph associated with the virtual service. - - Should be in the format. - - This is applicable only for service integration mode with cisco apic controller. - - Field introduced in 17.2.12,18.1.2. - application_profile_ref: - description: - - Enable application layer specific features for the virtual service. - - It is a reference to an object of type applicationprofile. - auto_allocate_floating_ip: - description: - - Auto-allocate floating/elastic ip from the cloud infrastructure. - - Field deprecated in 17.1.1. - type: bool - auto_allocate_ip: - description: - - Auto-allocate vip from the provided subnet. - - Field deprecated in 17.1.1. - type: bool - availability_zone: - description: - - Availability-zone to place the virtual service. - - Field deprecated in 17.1.1. - avi_allocated_fip: - description: - - (internal-use) fip allocated by avi in the cloud infrastructure. - - Field deprecated in 17.1.1. - type: bool - avi_allocated_vip: - description: - - (internal-use) vip allocated by avi in the cloud infrastructure. - - Field deprecated in 17.1.1. - type: bool - azure_availability_set: - description: - - (internal-use)applicable for azure only. - - Azure availability set to which this vs is associated. - - Internally set by the cloud connector. - - Field introduced in 17.2.12, 18.1.2. - bulk_sync_kvcache: - description: - - (this is a beta feature). - - Sync key-value cache to the new ses when vs is scaled out. - - For ex ssl sessions are stored using vs's key-value cache. - - When the vs is scaled out, the ssl session information is synced to the new se, allowing existing ssl sessions to be reused on the new se. - - Field introduced in 17.2.7, 18.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - client_auth: - description: - - Http authentication configuration for protected resources. - close_client_conn_on_config_update: - description: - - Close client connection on vs config update. - - Field introduced in 17.2.4. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - cloud_config_cksum: - description: - - Checksum of cloud configuration for vs. - - Internally set by cloud connector. - cloud_ref: - description: - - It is a reference to an object of type cloud. - cloud_type: - description: - - 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_azure, cloud_gcp. - - Default value when not specified in API or module is interpreted by Avi Controller as CLOUD_NONE. - connections_rate_limit: - description: - - Rate limit the incoming connections to this virtual service. - content_rewrite: - description: - - Profile used to match and rewrite strings in request and/or response body. - created_by: - description: - - Creator name. - delay_fairness: - description: - - Select the algorithm for qos fairness. - - This determines how multiple virtual services sharing the same service engines will prioritize traffic over a congested network. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - description: - description: - - User defined description for the object. - discovered_network_ref: - description: - - (internal-use) discovered networks providing reachability for client facing virtual service ip. - - This field is deprecated. - - It is a reference to an object of type network. - - Field deprecated in 17.1.1. - discovered_networks: - description: - - (internal-use) discovered networks providing reachability for client facing virtual service ip. - - This field is used internally by avi, not editable by the user. - - Field deprecated in 17.1.1. - discovered_subnet: - description: - - (internal-use) discovered subnets providing reachability for client facing virtual service ip. - - This field is deprecated. - - Field deprecated in 17.1.1. - dns_info: - description: - - Service discovery specific data including fully qualified domain name, type and time-to-live of the dns record. - - Note that only one of fqdn and dns_info setting is allowed. - dns_policies: - description: - - Dns policies applied on the dns traffic of the virtual service. - - Field introduced in 17.1.1. - east_west_placement: - description: - - Force placement on all se's in service group (mesos mode only). - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - enable_autogw: - description: - - Response traffic to clients will be sent back to the source mac address of the connection, rather than statically sent to a default gateway. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - enable_rhi: - description: - - Enable route health injection using the bgp config in the vrf context. - type: bool - enable_rhi_snat: - description: - - Enable route health injection for source nat'ted floating ip address using the bgp config in the vrf context. - type: bool - enabled: - description: - - Enable or disable the virtual service. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - error_page_profile_ref: - description: - - Error page profile to be used for this virtualservice.this profile is used to send the custom error page to the client generated by the proxy. - - It is a reference to an object of type errorpageprofile. - - Field introduced in 17.2.4. - floating_ip: - description: - - Floating ip to associate with this virtual service. - - Field deprecated in 17.1.1. - floating_subnet_uuid: - description: - - If auto_allocate_floating_ip is true and more than one floating-ip subnets exist, then the subnet for the floating ip address allocation. - - This field is applicable only if the virtualservice belongs to an openstack or aws cloud. - - In openstack or aws cloud it is required when auto_allocate_floating_ip is selected. - - Field deprecated in 17.1.1. - flow_dist: - description: - - Criteria for flow distribution among ses. - - Enum options - LOAD_AWARE, CONSISTENT_HASH_SOURCE_IP_ADDRESS, CONSISTENT_HASH_SOURCE_IP_ADDRESS_AND_PORT. - - Default value when not specified in API or module is interpreted by Avi Controller as LOAD_AWARE. - flow_label_type: - description: - - Criteria for flow labelling. - - Enum options - NO_LABEL, APPLICATION_LABEL, SERVICE_LABEL. - - Default value when not specified in API or module is interpreted by Avi Controller as NO_LABEL. - fqdn: - description: - - Dns resolvable, fully qualified domain name of the virtualservice. - - Only one of 'fqdn' and 'dns_info' configuration is allowed. - host_name_xlate: - description: - - Translate the host name sent to the servers to this value. - - Translate the host name sent from servers back to the value used by the client. - http_policies: - description: - - Http policies applied on the data traffic of the virtual service. - ign_pool_net_reach: - description: - - Ignore pool servers network reachability constraints for virtual service placement. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - ip_address: - description: - - Ip address of the virtual service. - - Field deprecated in 17.1.1. - ipam_network_subnet: - description: - - Subnet and/or network for allocating virtualservice ip by ipam provider module. - - Field deprecated in 17.1.1. - l4_policies: - description: - - L4 policies applied to the data traffic of the virtual service. - - Field introduced in 17.2.7. - limit_doser: - description: - - Limit potential dos attackers who exceed max_cps_per_client significantly to a fraction of max_cps_per_client for a while. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - max_cps_per_client: - description: - - Maximum connections per second per client ip. - - Allowed values are 10-1000. - - Special values are 0- 'unlimited'. - - Default value when not specified in API or module is interpreted by Avi Controller as 0. - microservice_ref: - description: - - Microservice representing the virtual service. - - It is a reference to an object of type microservice. - min_pools_up: - description: - - Minimum number of up pools to mark vs up. - - Field introduced in 18.2.1, 17.2.12. - name: - description: - - Name for the virtual service. - required: true - network_profile_ref: - description: - - Determines network settings such as protocol, tcp or udp, and related options for the protocol. - - It is a reference to an object of type networkprofile. - network_ref: - description: - - Manually override the network on which the virtual service is placed. - - It is a reference to an object of type network. - - Field deprecated in 17.1.1. - network_security_policy_ref: - description: - - Network security policies for the virtual service. - - It is a reference to an object of type networksecuritypolicy. - nsx_securitygroup: - description: - - A list of nsx service groups representing the clients which can access the virtual ip of the virtual service. - - Field introduced in 17.1.1. - performance_limits: - description: - - Optional settings that determine performance limits like max connections or bandwidth etc. - pool_group_ref: - description: - - The pool group is an object that contains pools. - - It is a reference to an object of type poolgroup. - pool_ref: - description: - - The pool is an object that contains destination servers and related attributes such as load-balancing and persistence. - - It is a reference to an object of type pool. - port_uuid: - description: - - (internal-use) network port assigned to the virtual service ip address. - - Field deprecated in 17.1.1. - remove_listening_port_on_vs_down: - description: - - Remove listening port if virtualservice is down. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - requests_rate_limit: - description: - - Rate limit the incoming requests to this virtual service. - saml_sp_config: - description: - - Application-specific saml config. - - Field introduced in 18.2.3. - scaleout_ecmp: - description: - - Disable re-distribution of flows across service engines for a virtual service. - - Enable if the network itself performs flow hashing with ecmp in environments such as gcp. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - se_group_ref: - description: - - The service engine group to use for this virtual service. - - Moving to a new se group is disruptive to existing connections for this vs. - - It is a reference to an object of type serviceenginegroup. - security_policy_ref: - description: - - Security policy applied on the traffic of the virtual service. - - This policy is used to perform security actions such as distributed denial of service (ddos) attack mitigation, etc. - - It is a reference to an object of type securitypolicy. - - Field introduced in 18.2.1. - server_network_profile_ref: - description: - - Determines the network settings profile for the server side of tcp proxied connections. - - Leave blank to use the same settings as the client to vs side of the connection. - - It is a reference to an object of type networkprofile. - service_metadata: - description: - - Metadata pertaining to the service provided by this virtual service. - - In openshift/kubernetes environments, egress pod info is stored. - - Any user input to this field will be overwritten by avi vantage. - service_pool_select: - description: - - Select pool based on destination port. - services: - description: - - List of services defined for this virtual service. - sideband_profile: - description: - - Sideband configuration to be used for this virtualservice.it can be used for sending traffic to sideband vips for external inspection etc. - snat_ip: - description: - - Nat'ted floating source ip address(es) for upstream connection to servers. - sp_pool_refs: - description: - - Gslb pools used to manage site-persistence functionality. - - Each site-persistence pool contains the virtualservices in all the other sites, that is auto-generated by the gslb manager. - - This is a read-only field for the user. - - It is a reference to an object of type pool. - - Field introduced in 17.2.2. - ssl_key_and_certificate_refs: - description: - - Select or create one or two certificates, ec and/or rsa, that will be presented to ssl/tls terminated connections. - - It is a reference to an object of type sslkeyandcertificate. - ssl_profile_ref: - description: - - Determines the set of ssl versions and ciphers to accept for ssl/tls terminated connections. - - It is a reference to an object of type sslprofile. - ssl_profile_selectors: - description: - - Select ssl profile based on client ip address match. - - Field introduced in 18.2.3. - ssl_sess_cache_avg_size: - description: - - Expected number of ssl session cache entries (may be exceeded). - - Allowed values are 1024-16383. - - Default value when not specified in API or module is interpreted by Avi Controller as 1024. - sso_policy: - description: - - Client authentication and authorization policy for the virtualservice. - - Field deprecated in 18.2.3. - - Field introduced in 18.2.1. - sso_policy_ref: - description: - - The sso policy attached to the virtualservice. - - It is a reference to an object of type ssopolicy. - - Field introduced in 18.2.3. - static_dns_records: - description: - - List of static dns records applied to this virtual service. - - These are static entries and no health monitoring is performed against the ip addresses. - subnet: - description: - - Subnet providing reachability for client facing virtual service ip. - - Field deprecated in 17.1.1. - subnet_uuid: - description: - - It represents subnet for the virtual service ip address allocation when auto_allocate_ip is true.it is only applicable in openstack or aws cloud. - - This field is required if auto_allocate_ip is true. - - Field deprecated in 17.1.1. - tenant_ref: - description: - - It is a reference to an object of type tenant. - topology_policies: - description: - - Topology policies applied on the dns traffic of the virtual service based ongslb topology algorithm. - - Field introduced in 18.2.3. - traffic_clone_profile_ref: - description: - - Server network or list of servers for cloning traffic. - - It is a reference to an object of type trafficcloneprofile. - - Field introduced in 17.1.1. - traffic_enabled: - description: - - Knob to enable the virtual service traffic on its assigned service engines. - - This setting is effective only when the enabled flag is set to true. - - Field introduced in 17.2.8. - - Default value when not specified in API or module is interpreted by Avi Controller as True. - type: bool - type: - description: - - Specify if this is a normal virtual service, or if it is the parent or child of an sni-enabled virtual hosted virtual service. - - Enum options - VS_TYPE_NORMAL, VS_TYPE_VH_PARENT, VS_TYPE_VH_CHILD. - - Default value when not specified in API or module is interpreted by Avi Controller as VS_TYPE_NORMAL. - url: - description: - - Avi controller URL of the object. - use_bridge_ip_as_vip: - description: - - Use bridge ip as vip on each host in mesos deployments. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - use_vip_as_snat: - description: - - Use the virtual ip as the snat ip for health monitoring and sending traffic to the backend servers instead of the service engine interface ip. - - The caveat of enabling this option is that the virtualservice cannot be configued in an active-active ha mode. - - Dns based multi vip solution has to be used for ha & non-disruptive upgrade purposes. - - Field introduced in 17.1.9,17.2.3. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - uuid: - description: - - Uuid of the virtualservice. - vh_domain_name: - description: - - The exact name requested from the client's sni-enabled tls hello domain name field. - - If this is a match, the parent vs will forward the connection to this child vs. - vh_parent_vs_uuid: - description: - - Specifies the virtual service acting as virtual hosting (sni) parent. - vip: - description: - - List of virtual service ips. - - While creating a 'shared vs',please use vsvip_ref to point to the shared entities. - - Field introduced in 17.1.1. - vrf_context_ref: - description: - - Virtual routing context that the virtual service is bound to. - - This is used to provide the isolation of the set of networks the application is attached to. - - It is a reference to an object of type vrfcontext. - vs_datascripts: - description: - - Datascripts applied on the data traffic of the virtual service. - vsvip_cloud_config_cksum: - description: - - Checksum of cloud configuration for vsvip. - - Internally set by cloud connector. - - Field introduced in 17.2.9, 18.1.2. - vsvip_ref: - description: - - Mostly used during the creation of shared vs, this field refers to entities that can be shared across virtual services. - - It is a reference to an object of type vsvip. - - Field introduced in 17.1.1. - waf_policy_ref: - description: - - Waf policy for the virtual service. - - It is a reference to an object of type wafpolicy. - - Field introduced in 17.2.1. - weight: - description: - - The quality of service weight to assign to traffic transmitted from this virtual service. - - A higher weight will prioritize traffic versus other virtual services sharing the same service engines. - - Allowed values are 1-128. - - Default value when not specified in API or module is interpreted by Avi Controller as 1. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Create SSL Virtual Service using Pool testpool2 - community.network.avi_virtualservice: - controller: 10.10.27.90 - username: admin - password: AviNetworks123! - name: newtestvs - state: present - performance_limits: - max_concurrent_connections: 1000 - services: - - port: 443 - enable_ssl: true - - port: 80 - ssl_profile_ref: '/api/sslprofile?name=System-Standard' - application_profile_ref: '/api/applicationprofile?name=System-Secure-HTTP' - ssl_key_and_certificate_refs: - - '/api/sslkeyandcertificate?name=System-Default-Cert' - ip_address: - addr: 10.90.131.103 - type: V4 - pool_ref: '/api/pool?name=testpool2' -""" - -RETURN = ''' -obj: - description: VirtualService (api/virtualservice) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - active_standby_se_tag=dict(type='str',), - allow_invalid_client_cert=dict(type='bool',), - analytics_policy=dict(type='dict',), - analytics_profile_ref=dict(type='str',), - apic_contract_graph=dict(type='str',), - application_profile_ref=dict(type='str',), - auto_allocate_floating_ip=dict(type='bool',), - auto_allocate_ip=dict(type='bool',), - availability_zone=dict(type='str',), - avi_allocated_fip=dict(type='bool',), - avi_allocated_vip=dict(type='bool',), - azure_availability_set=dict(type='str',), - bulk_sync_kvcache=dict(type='bool',), - client_auth=dict(type='dict',), - close_client_conn_on_config_update=dict(type='bool',), - cloud_config_cksum=dict(type='str',), - cloud_ref=dict(type='str',), - cloud_type=dict(type='str',), - connections_rate_limit=dict(type='dict',), - content_rewrite=dict(type='dict',), - created_by=dict(type='str',), - delay_fairness=dict(type='bool',), - description=dict(type='str',), - discovered_network_ref=dict(type='list',), - discovered_networks=dict(type='list',), - discovered_subnet=dict(type='list',), - dns_info=dict(type='list',), - dns_policies=dict(type='list',), - east_west_placement=dict(type='bool',), - enable_autogw=dict(type='bool',), - enable_rhi=dict(type='bool',), - enable_rhi_snat=dict(type='bool',), - enabled=dict(type='bool',), - error_page_profile_ref=dict(type='str',), - floating_ip=dict(type='dict',), - floating_subnet_uuid=dict(type='str',), - flow_dist=dict(type='str',), - flow_label_type=dict(type='str',), - fqdn=dict(type='str',), - host_name_xlate=dict(type='str',), - http_policies=dict(type='list',), - ign_pool_net_reach=dict(type='bool',), - ip_address=dict(type='dict',), - ipam_network_subnet=dict(type='dict',), - l4_policies=dict(type='list',), - limit_doser=dict(type='bool',), - max_cps_per_client=dict(type='int',), - microservice_ref=dict(type='str',), - min_pools_up=dict(type='int',), - name=dict(type='str', required=True), - network_profile_ref=dict(type='str',), - network_ref=dict(type='str',), - network_security_policy_ref=dict(type='str',), - nsx_securitygroup=dict(type='list',), - performance_limits=dict(type='dict',), - pool_group_ref=dict(type='str',), - pool_ref=dict(type='str',), - port_uuid=dict(type='str',), - remove_listening_port_on_vs_down=dict(type='bool',), - requests_rate_limit=dict(type='dict',), - saml_sp_config=dict(type='dict',), - scaleout_ecmp=dict(type='bool',), - se_group_ref=dict(type='str',), - security_policy_ref=dict(type='str',), - server_network_profile_ref=dict(type='str',), - service_metadata=dict(type='str',), - service_pool_select=dict(type='list',), - services=dict(type='list',), - sideband_profile=dict(type='dict',), - snat_ip=dict(type='list',), - sp_pool_refs=dict(type='list',), - ssl_key_and_certificate_refs=dict(type='list', no_log=False), - ssl_profile_ref=dict(type='str',), - ssl_profile_selectors=dict(type='list',), - ssl_sess_cache_avg_size=dict(type='int',), - sso_policy=dict(type='dict',), - sso_policy_ref=dict(type='str',), - static_dns_records=dict(type='list',), - subnet=dict(type='dict',), - subnet_uuid=dict(type='str',), - tenant_ref=dict(type='str',), - topology_policies=dict(type='list',), - traffic_clone_profile_ref=dict(type='str',), - traffic_enabled=dict(type='bool',), - type=dict(type='str',), - url=dict(type='str',), - use_bridge_ip_as_vip=dict(type='bool',), - use_vip_as_snat=dict(type='bool',), - uuid=dict(type='str',), - vh_domain_name=dict(type='list',), - vh_parent_vs_uuid=dict(type='str',), - vip=dict(type='list',), - vrf_context_ref=dict(type='str',), - vs_datascripts=dict(type='list',), - vsvip_cloud_config_cksum=dict(type='str',), - vsvip_ref=dict(type='str',), - waf_policy_ref=dict(type='str',), - weight=dict(type='int',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'virtualservice', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_vrfcontext.py b/plugins/modules/network/avi/avi_vrfcontext.py deleted file mode 100644 index c4294245..00000000 --- a/plugins/modules/network/avi/avi_vrfcontext.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.2 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_vrfcontext -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of VrfContext Avi RESTful Object -description: - - This module is used to configure VrfContext object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - bgp_profile: - description: - - Bgp local and peer info. - cloud_ref: - description: - - It is a reference to an object of type cloud. - debugvrfcontext: - description: - - Configure debug flags for vrf. - - Field introduced in 17.1.1. - description: - description: - - User defined description for the object. - gateway_mon: - description: - - Configure ping based heartbeat check for gateway in service engines of vrf. - internal_gateway_monitor: - description: - - Configure ping based heartbeat check for all default gateways in service engines of vrf. - - Field introduced in 17.1.1. - name: - description: - - Name of the object. - required: true - static_routes: - description: - - List of staticroute. - system_default: - description: - - Boolean flag to set system_default. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Unique object identifier of the object. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create VrfContext object - community.network.avi_vrfcontext: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_vrfcontext -""" - -RETURN = ''' -obj: - description: VrfContext (api/vrfcontext) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - bgp_profile=dict(type='dict',), - cloud_ref=dict(type='str',), - debugvrfcontext=dict(type='dict',), - description=dict(type='str',), - gateway_mon=dict(type='list',), - internal_gateway_monitor=dict(type='dict',), - name=dict(type='str', required=True), - static_routes=dict(type='list',), - system_default=dict(type='bool',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'vrfcontext', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_vsdatascriptset.py b/plugins/modules/network/avi/avi_vsdatascriptset.py deleted file mode 100644 index 1558d00c..00000000 --- a/plugins/modules/network/avi/avi_vsdatascriptset.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.1 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_vsdatascriptset -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of VSDataScriptSet Avi RESTful Object -description: - - This module is used to configure VSDataScriptSet object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - created_by: - description: - - Creator name. - - Field introduced in 17.1.11,17.2.4. - datascript: - description: - - Datascripts to execute. - description: - description: - - User defined description for the object. - ipgroup_refs: - description: - - Uuid of ip groups that could be referred by vsdatascriptset objects. - - It is a reference to an object of type ipaddrgroup. - name: - description: - - Name for the virtual service datascript collection. - required: true - pool_group_refs: - description: - - Uuid of pool groups that could be referred by vsdatascriptset objects. - - It is a reference to an object of type poolgroup. - pool_refs: - description: - - Uuid of pools that could be referred by vsdatascriptset objects. - - It is a reference to an object of type pool. - protocol_parser_refs: - description: - - List of protocol parsers that could be referred by vsdatascriptset objects. - - It is a reference to an object of type protocolparser. - - Field introduced in 18.2.3. - string_group_refs: - description: - - Uuid of string groups that could be referred by vsdatascriptset objects. - - It is a reference to an object of type stringgroup. - tenant_ref: - description: - - It is a reference to an object of type tenant. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the virtual service datascript collection. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create VSDataScriptSet object - community.network.avi_vsdatascriptset: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_vsdatascriptset -""" - -RETURN = ''' -obj: - description: VSDataScriptSet (api/vsdatascriptset) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - created_by=dict(type='str',), - datascript=dict(type='list',), - description=dict(type='str',), - ipgroup_refs=dict(type='list',), - name=dict(type='str', required=True), - pool_group_refs=dict(type='list',), - pool_refs=dict(type='list',), - protocol_parser_refs=dict(type='list',), - string_group_refs=dict(type='list',), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'vsdatascriptset', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_vsvip.py b/plugins/modules/network/avi/avi_vsvip.py deleted file mode 100644 index 6aa86a3a..00000000 --- a/plugins/modules/network/avi/avi_vsvip.py +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# Avi Version: 17.1.2 -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_vsvip -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of VsVip Avi RESTful Object -description: - - This module is used to configure VsVip object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - cloud_ref: - description: - - It is a reference to an object of type cloud. - - Field introduced in 17.1.1. - dns_info: - description: - - Service discovery specific data including fully qualified domain name, type and time-to-live of the dns record. - - Field introduced in 17.1.1. - east_west_placement: - description: - - Force placement on all service engines in the service engine group (container clouds only). - - Field introduced in 17.1.1. - - Default value when not specified in API or module is interpreted by Avi Controller as False. - type: bool - name: - description: - - Name for the vsvip object. - - Field introduced in 17.1.1. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.1.1. - url: - description: - - Avi controller URL of the object. - use_standard_alb: - description: - - This overrides the cloud level default and needs to match the se group value in which it will be used if the se group use_standard_alb value is - - set. - - This is only used when fip is used for vs on azure cloud. - - Field introduced in 18.2.3. - type: bool - uuid: - description: - - Uuid of the vsvip object. - - Field introduced in 17.1.1. - vip: - description: - - List of virtual service ips and other shareable entities. - - Field introduced in 17.1.1. - vrf_context_ref: - description: - - Virtual routing context that the virtual service is bound to. - - This is used to provide the isolation of the set of networks the application is attached to. - - It is a reference to an object of type vrfcontext. - - Field introduced in 17.1.1. - vsvip_cloud_config_cksum: - description: - - Checksum of cloud configuration for vsvip. - - Internally set by cloud connector. - - Field introduced in 17.2.9, 18.1.2. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create VsVip object - community.network.avi_vsvip: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_vsvip -""" - -RETURN = ''' -obj: - description: VsVip (api/vsvip) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - cloud_ref=dict(type='str',), - dns_info=dict(type='list',), - east_west_placement=dict(type='bool',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - use_standard_alb=dict(type='bool',), - uuid=dict(type='str',), - vip=dict(type='list',), - vrf_context_ref=dict(type='str',), - vsvip_cloud_config_cksum=dict(type='str',), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'vsvip', - set([])) - - -if __name__ == '__main__': - main() diff --git a/plugins/modules/network/avi/avi_webhook.py b/plugins/modules/network/avi/avi_webhook.py deleted file mode 100644 index f6e1321e..00000000 --- a/plugins/modules/network/avi/avi_webhook.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/python -# -# @author: Gaurav Rastogi (grastogi@avinetworks.com) -# Eric Anderson (eanderson@avinetworks.com) -# module_check: supported -# -# Copyright: (c) 2017 Gaurav Rastogi, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -DOCUMENTATION = ''' ---- -module: avi_webhook -author: Gaurav Rastogi (@grastogi23) - -short_description: Module for setup of Webhook Avi RESTful Object -description: - - This module is used to configure Webhook object - - more examples at U(https://github.com/avinetworks/devops) -requirements: [ avisdk ] -options: - state: - description: - - The state that should be applied on the entity. - default: 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. - default: put - choices: ["put", "patch"] - avi_api_patch_op: - description: - - Patch operation to use when using avi_api_update_method as patch. - choices: ["add", "replace", "delete"] - callback_url: - description: - - Callback url for the webhook. - - Field introduced in 17.1.1. - description: - description: - - Field introduced in 17.1.1. - name: - description: - - The name of the webhook profile. - - Field introduced in 17.1.1. - required: true - tenant_ref: - description: - - It is a reference to an object of type tenant. - - Field introduced in 17.1.1. - url: - description: - - Avi controller URL of the object. - uuid: - description: - - Uuid of the webhook profile. - - Field introduced in 17.1.1. - verification_token: - description: - - Verification token sent back with the callback asquery parameters. - - Field introduced in 17.1.1. -extends_documentation_fragment: -- community.network.avi - -''' - -EXAMPLES = """ -- name: Example to create Webhook object - community.network.avi_webhook: - controller: 10.10.25.42 - username: admin - password: something - state: present - name: sample_webhook -""" - -RETURN = ''' -obj: - description: Webhook (api/webhook) object - returned: success, changed - type: dict -''' - -from ansible.module_utils.basic import AnsibleModule -try: - from ansible_collections.community.network.plugins.module_utils.network.avi.avi import ( - avi_common_argument_spec, avi_ansible_api, HAS_AVI) -except ImportError: - HAS_AVI = False - - -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']), - callback_url=dict(type='str',), - description=dict(type='str',), - name=dict(type='str', required=True), - tenant_ref=dict(type='str',), - url=dict(type='str',), - uuid=dict(type='str',), - verification_token=dict(type='str', no_log=True), - ) - argument_specs.update(avi_common_argument_spec()) - module = AnsibleModule( - argument_spec=argument_specs, supports_check_mode=True) - if not HAS_AVI: - return module.fail_json(msg=( - 'Avi python API SDK (avisdk>=17.1) or requests is not installed. ' - 'For more details visit https://github.com/avinetworks/sdk.')) - return avi_ansible_api(module, 'webhook', - set([])) - - -if __name__ == '__main__': - main() diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 9aba0da8..bdefee43 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -46,175 +46,6 @@ plugins/modules/network/aruba/aruba_config.py validate-modules:doc-missing-type plugins/modules/network/aruba/aruba_config.py validate-modules:doc-required-mismatch plugins/modules/network/aruba/aruba_config.py validate-modules:parameter-list-no-elements plugins/modules/network/aruba/aruba_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_session.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_session.py validate-modules:doc-required-mismatch -plugins/modules/network/avi/avi_api_session.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_version.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_version.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_authprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_authprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloud.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloud.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cloud.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cluster.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cluster.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslb.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslb.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslb.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslbservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_l4policyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_l4policyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_network.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_network.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_network.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networkprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networkprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pool.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pool.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_pool.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_poolgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_role.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_role.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_role.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_scheduler.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_scheduler.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_seproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_seproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceengine.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceengine.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serviceengine.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_sslprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_stringgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_stringgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_stringgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_tenant.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_tenant.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_user.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_user.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_user.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccount.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccount.py validate-modules:doc-required-mismatch -plugins/modules/network/avi/avi_useraccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_virtualservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_virtualservice.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_virtualservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsvip.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsvip.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vsvip.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_webhook.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_webhook.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bcf_switch.py validate-modules:doc-missing-type plugins/modules/network/bigswitch/bcf_switch.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bigmon_chain.py validate-modules:doc-missing-type diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 9aba0da8..bdefee43 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -46,175 +46,6 @@ plugins/modules/network/aruba/aruba_config.py validate-modules:doc-missing-type plugins/modules/network/aruba/aruba_config.py validate-modules:doc-required-mismatch plugins/modules/network/aruba/aruba_config.py validate-modules:parameter-list-no-elements plugins/modules/network/aruba/aruba_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_session.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_session.py validate-modules:doc-required-mismatch -plugins/modules/network/avi/avi_api_session.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_version.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_version.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_authprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_authprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloud.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloud.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cloud.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cluster.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cluster.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslb.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslb.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslb.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslbservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_l4policyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_l4policyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_network.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_network.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_network.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networkprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networkprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pool.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pool.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_pool.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_poolgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_role.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_role.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_role.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_scheduler.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_scheduler.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_seproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_seproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceengine.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceengine.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serviceengine.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_sslprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_stringgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_stringgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_stringgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_tenant.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_tenant.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_user.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_user.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_user.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccount.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccount.py validate-modules:doc-required-mismatch -plugins/modules/network/avi/avi_useraccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_virtualservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_virtualservice.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_virtualservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsvip.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsvip.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vsvip.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_webhook.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_webhook.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bcf_switch.py validate-modules:doc-missing-type plugins/modules/network/bigswitch/bcf_switch.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bigmon_chain.py validate-modules:doc-missing-type diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 9aba0da8..bdefee43 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -46,175 +46,6 @@ plugins/modules/network/aruba/aruba_config.py validate-modules:doc-missing-type plugins/modules/network/aruba/aruba_config.py validate-modules:doc-required-mismatch plugins/modules/network/aruba/aruba_config.py validate-modules:parameter-list-no-elements plugins/modules/network/aruba/aruba_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_session.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_session.py validate-modules:doc-required-mismatch -plugins/modules/network/avi/avi_api_session.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_version.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_version.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_authprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_authprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloud.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloud.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cloud.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cluster.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cluster.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_cluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslb.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslb.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslb.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_gslbservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_l4policyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_l4policyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_network.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_network.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_network.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networkprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networkprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pool.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pool.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_pool.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_poolgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_role.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_role.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_role.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_scheduler.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_scheduler.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_seproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_seproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceengine.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceengine.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serviceengine.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_sslprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_stringgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_stringgroup.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_stringgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_tenant.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_tenant.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_user.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_user.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_user.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccount.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccount.py validate-modules:doc-required-mismatch -plugins/modules/network/avi/avi_useraccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_virtualservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_virtualservice.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_virtualservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsvip.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsvip.py validate-modules:parameter-list-no-elements -plugins/modules/network/avi/avi_vsvip.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_webhook.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_webhook.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bcf_switch.py validate-modules:doc-missing-type plugins/modules/network/bigswitch/bcf_switch.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bigmon_chain.py validate-modules:doc-missing-type diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 26721d92..49293fb7 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -28,136 +28,6 @@ plugins/modules/network/aruba/aruba_command.py validate-modules:parameter-type-n plugins/modules/network/aruba/aruba_config.py validate-modules:doc-default-does-not-match-spec plugins/modules/network/aruba/aruba_config.py validate-modules:doc-missing-type plugins/modules/network/aruba/aruba_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_actiongroupconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertemailconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertscriptconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_alertsyslogconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_analyticsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_session.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_session.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_api_version.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_api_version.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationpersistenceprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_applicationprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_authprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_authprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_autoscalelaunchconfig.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_backupconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_certificatemanagementprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloud.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloud.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudconnectoruser.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cloudproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_cluster.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_cluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_clusterclouddetails.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_controllerproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_customipamdnsprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_dnspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpagebody.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_errorpageprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslb.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslb.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbgeodbprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_gslbservice_patch_member.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_hardwaresecuritymodulegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_healthmonitor.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_httppolicyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipaddrgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_ipamdnsproviderprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_l4policyset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_l4policyset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_microservicegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_network.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_network.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networkprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networkprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_networksecuritypolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pkiprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_pool.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_pool.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_poolgroupdeploymentpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_prioritylabels.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_role.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_role.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_scheduler.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_scheduler.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_seproperties.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_seproperties.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serverautoscalepolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceengine.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceengine.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_serviceenginegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_snmptrapprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslkeyandcertificate.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_sslprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_sslprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_stringgroup.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_stringgroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_systemconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_tenant.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_tenant.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_trafficcloneprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_user.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_user.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccount.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_useraccountprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_virtualservice.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_virtualservice.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vrfcontext.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsdatascriptset.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_vsvip.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_vsvip.py validate-modules:parameter-type-not-in-doc -plugins/modules/network/avi/avi_webhook.py validate-modules:doc-missing-type -plugins/modules/network/avi/avi_webhook.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bcf_switch.py validate-modules:doc-missing-type plugins/modules/network/bigswitch/bcf_switch.py validate-modules:parameter-type-not-in-doc plugins/modules/network/bigswitch/bigmon_chain.py validate-modules:doc-missing-type diff --git a/tests/unit/plugins/lookup/__init__.py b/tests/unit/plugins/lookup/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/plugins/lookup/fixtures/avi.json b/tests/unit/plugins/lookup/fixtures/avi.json deleted file mode 100644 index ae89ca68..00000000 --- a/tests/unit/plugins/lookup/fixtures/avi.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "mock_single_obj": { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "PG-123", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - "mock_multiple_obj": { - "results": [ - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0682", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0231", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1627-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1627-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1627-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0535", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1934-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1934-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1934-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0094", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1458-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1458-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1458-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0437", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1836-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1836-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1836-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0673", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-2075-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-2075-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-2075-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - } - ] - } -} diff --git a/tests/unit/plugins/lookup/test_avi.py b/tests/unit/plugins/lookup/test_avi.py deleted file mode 100644 index 9989bbaf..00000000 --- a/tests/unit/plugins/lookup/test_avi.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -# (c) 2019, Sandeep Bandi -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import os -import pytest -import json - -from ansible_collections.community.network.tests.unit.compat.mock import patch, MagicMock - -from ansible.errors import AnsibleError -from ansible.plugins.loader import lookup_loader -from ansible_collections.community.network.plugins.lookup import avi - - -try: - import builtins as __builtin__ -except ImportError: - import __builtin__ - - -fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') - -with open(fixture_path + '/avi.json') as json_file: - data = json.load(json_file) - - -@pytest.fixture -def dummy_credentials(): - dummy_credentials = {} - dummy_credentials['controller'] = "192.0.2.13" - dummy_credentials['username'] = "admin" - dummy_credentials['password'] = "password" - dummy_credentials['api_version'] = "17.2.14" - dummy_credentials['tenant'] = 'admin' - return dummy_credentials - - -@pytest.fixture -def super_switcher(scope="function", autouse=True): - # Mocking the inbuilt super as it is used in ApiSession initialization - original_super = __builtin__.super - __builtin__.super = MagicMock() - yield - # Revert the super to default state - __builtin__.super = original_super - - -def test_lookup_multiple_obj(dummy_credentials): - avi_lookup = lookup_loader.get('community.network.avi') - avi_mock = MagicMock() - avi_mock.return_value.get.return_value.json.return_value = data["mock_multiple_obj"] - with patch.object(avi, 'ApiSession', avi_mock): - retval = avi_lookup.run([], {}, avi_credentials=dummy_credentials, - obj_type="network") - assert retval == data["mock_multiple_obj"]["results"] - - -def test_lookup_single_obj(dummy_credentials): - avi_lookup = lookup_loader.get('community.network.avi') - avi_mock = MagicMock() - avi_mock.return_value.get_object_by_name.return_value = data["mock_single_obj"] - with patch.object(avi, 'ApiSession', avi_mock): - retval = avi_lookup.run([], {}, avi_credentials=dummy_credentials, - obj_type="network", obj_name='PG-123') - assert retval[0] == data["mock_single_obj"] - - -def test_invalid_lookup(dummy_credentials): - avi_lookup = lookup_loader.get('community.network.avi') - avi_mock = MagicMock() - with pytest.raises(AnsibleError): - with patch.object(avi, 'ApiSession', avi_mock): - avi_lookup.run([], {}, avi_credentials=dummy_credentials) diff --git a/tests/unit/plugins/module_utils/network/avi/__init__.py b/tests/unit/plugins/module_utils/network/avi/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/plugins/module_utils/network/avi/test_avi_api_utils.py b/tests/unit/plugins/module_utils/network/avi/test_avi_api_utils.py deleted file mode 100644 index 105ea62e..00000000 --- a/tests/unit/plugins/module_utils/network/avi/test_avi_api_utils.py +++ /dev/null @@ -1,703 +0,0 @@ -''' -Created on Aug 16, 2016 - -@author: grastogi -''' - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -import unittest -from ansible_collections.community.network.plugins.module_utils.network.avi.ansible_utils import \ - cleanup_absent_fields, avi_obj_cmp - - -class TestAviApiUtils(unittest.TestCase): - - def test_avi_obj_cmp(self): - obj = {'name': 'testpool'} - existing_obj = { - 'lb_algorithm': 'LB_ALGORITHM_LEAST_CONNECTIONS', - 'use_service_port': False, - 'server_auto_scale': False, - 'host_check_enabled': False, - 'enabled': True, - 'capacity_estimation': False, - 'fewest_tasks_feedback_delay': 10, - '_last_modified': '1471377748747040', - 'cloud_ref': 'https://192.0.2.42/api/cloud/cloud-afe8bf2c-9821-4272-9bc6-67634c84bec9', - 'vrf_ref': 'https://192.0.2.42/api/vrfcontext/vrfcontext-0e8ce760-fed2-4650-9397-5b3e4966376e', - 'inline_health_monitor': True, - 'default_server_port': 80, - 'request_queue_depth': 128, - 'graceful_disable_timeout': 1, - 'server_count': 0, - 'sni_enabled': True, - 'request_queue_enabled': False, - 'name': 'testpool', - 'max_concurrent_connections_per_server': 0, - 'url': 'https://192.0.2.42/api/pool/pool-20084ee1-872e-4103-98e1-899103e2242a', - 'tenant_ref': 'https://192.0.2.42/api/tenant/admin', - 'uuid': 'pool-20084ee1-872e-4103-98e1-899103e2242a', - 'connection_ramp_duration': 10} - - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - def test_avi_obj_cmp_w_refs(self): - obj = {'name': 'testpool', - 'health_monitor_refs': ['/api/healthmonitor?name=System-HTTP'], - 'enabled': True} - existing_obj = { - 'lb_algorithm': 'LB_ALGORITHM_LEAST_CONNECTIONS', - 'use_service_port': False, - 'server_auto_scale': False, - 'host_check_enabled': False, - 'enabled': True, - 'capacity_estimation': False, - 'fewest_tasks_feedback_delay': 10, - '_last_modified': '1471377748747040', - 'cloud_ref': 'https://192.0.2.42/api/cloud/cloud-afe8bf2c-9821-4272-9bc6-67634c84bec9', - 'vrf_ref': 'https://192.0.2.42/api/vrfcontext/vrfcontext-0e8ce760-fed2-4650-9397-5b3e4966376e', - 'inline_health_monitor': True, - 'default_server_port': 80, - 'request_queue_depth': 128, - 'graceful_disable_timeout': 1, - 'server_count': 0, - 'sni_enabled': True, - 'request_queue_enabled': False, - 'name': 'testpool', - 'max_concurrent_connections_per_server': 0, - 'url': 'https://192.0.2.42/api/pool/pool-20084ee1-872e-4103-98e1-899103e2242a', - 'tenant_ref': 'https://192.0.2.42/api/tenant/admin', - 'uuid': 'pool-20084ee1-872e-4103-98e1-899103e2242a', - 'connection_ramp_duration': 10, - 'health_monitor_refs': [ - "https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc9#System-HTTP"], - } - - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - obj = {'name': 'testpool', - 'health_monitor_refs': ['/api/healthmonitor?name=System-HTTP'], - 'server_count': 1} - diff = avi_obj_cmp(obj, existing_obj) - assert not diff - - obj = {'name': 'testpool', - 'health_monitor_refs': ['api/healthmonitor?name=System-HTTP'], - 'server_count': 0} - diff = avi_obj_cmp(obj, existing_obj) - assert not diff - obj = {'name': 'testpool', - 'health_monitor_refs': ['healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc9'], - 'server_count': 0} - diff = avi_obj_cmp(obj, existing_obj) - assert diff - obj = {'name': 'testpool#asdfasf', - 'health_monitor_refs': ['api/healthmonitor?name=System-HTTP'], - 'server_count': 0} - diff = avi_obj_cmp(obj, existing_obj) - assert not diff - obj = {'name': 'testpool', - 'health_monitor_refs': ['/api/healthmonitor?name=System-HTTP#'], - 'server_count': 0} - diff = avi_obj_cmp(obj, existing_obj) - assert not diff - - def test_avi_obj_cmp_empty_list(self): - obj = {'name': 'testpool', - 'health_monitor_refs': [], - 'enabled': True} - existing_obj = { - 'lb_algorithm': 'LB_ALGORITHM_LEAST_CONNECTIONS', - 'use_service_port': False, - 'server_auto_scale': False, - 'host_check_enabled': False, - 'enabled': True, - 'capacity_estimation': False, - 'fewest_tasks_feedback_delay': 10, - '_last_modified': '1471377748747040', - 'cloud_ref': 'https://192.0.2.42/api/cloud/cloud-afe8bf2c-9821-4272-9bc6-67634c84bec9', - 'vrf_ref': 'https://192.0.2.42/api/vrfcontext/vrfcontext-0e8ce760-fed2-4650-9397-5b3e4966376e', - 'inline_health_monitor': True, - 'default_server_port': 80, - 'request_queue_depth': 128, - 'graceful_disable_timeout': 1, - 'server_count': 0, - 'sni_enabled': True, - 'request_queue_enabled': False, - 'name': 'testpool', - 'max_concurrent_connections_per_server': 0, - 'url': 'https://192.0.2.42/api/pool/pool-20084ee1-872e-4103-98e1-899103e2242a', - 'tenant_ref': 'https://192.0.2.42/api/tenant/admin', - 'uuid': 'pool-20084ee1-872e-4103-98e1-899103e2242a', - 'connection_ramp_duration': 10 - } - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - def test_avi_obj_cmp_w_refs_n_name(self): - existing_obj = { - 'use_service_port': False, - 'server_auto_scale': False, - 'host_check_enabled': False, - 'enabled': True, - 'capacity_estimation': False, - 'fewest_tasks_feedback_delay': 10, - '_last_modified': '1471377748747040', - 'cloud_ref': 'https://192.0.2.42/api/cloud/cloud-afe8bf2c-9821-4272-9bc6-67634c84bec9', - 'vrf_ref': 'https://192.0.2.42/api/vrfcontext/vrfcontext-0e8ce760-fed2-4650-9397-5b3e4966376e', - 'inline_health_monitor': True, - 'default_server_port': 80, - 'request_queue_depth': 128, - 'graceful_disable_timeout': 1, - 'server_count': 0, - 'sni_enabled': True, - 'request_queue_enabled': False, - 'name': 'testpool', - 'max_concurrent_connections_per_server': 0, - 'url': 'https://192.0.2.42/api/pool/pool-20084ee1-872e-4103-98e1-899103e2242a', - 'tenant_ref': 'https://192.0.2.42/api/tenant/admin', - 'uuid': 'pool-20084ee1-872e-4103-98e1-899103e2242a', - 'connection_ramp_duration': 10, - 'health_monitor_refs': [ - "https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc9#System-HTTP", - "https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc8", - ], - } - - obj = {'name': 'testpool', - 'health_monitor_refs': ['https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc9', - "https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc8"], - 'server_count': 0} - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - obj = {'name': 'testpool', - 'health_monitor_refs': [ - 'https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc9#System-HTTP', - "https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc8"], - 'server_count': 0} - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - obj = {'name': 'testpool', - 'health_monitor_refs': [ - 'https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc9#System-HTTP', - "https://192.0.2.42/api/healthmonitor/healthmonitor-6d07b57f-126b-476c-baba-a8c8c8b06dc8#System-HTTP2"], - 'server_count': 0, - 'cloud_ref': 'https://192.0.2.42/api/cloud/cloud-afe8bf2c-9821-4272-9bc6-67634c84bec9#Default-Cloud', - } - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - def test_avi_list_update(self): - existing_obj = { - 'services': [ - { - "enable_ssl": False, - "port_range_end": 80, - "port": 80 - }, - { - "enable_ssl": False, - "port_range_end": 443, - "port": 443 - } - ], - "name": "vs-health-test", - "url": "https://192.0.2.42/api/virtualservice/virtualservice-526c55c2-df89-40b9-9de6-e45a472290aa", - } - - obj = { - 'services': [ - { - "enable_ssl": False, - "port_range_end": 80, - "port": 80 - } - ] - } - - diff = avi_obj_cmp(obj, existing_obj) - assert not diff - - obj = { - 'services': [ - { - "enable_ssl": False, - "port_range_end": 80, - "port": 80 - }, - { - "enable_ssl": False, - "port_range_end": 443, - "port": 80 - } - ], - "name": "vs-health-test", - "url": "https://192.0.2.42/api/virtualservice/virtualservice-526c55c2-df89-40b9-9de6-e45a472290aa", - } - - diff = avi_obj_cmp(obj, existing_obj) - assert not diff - - def test_cleanup_abset(self): - obj = {'x': 10, - 'y': {'state': 'absent'}, - 'z': {'a': {'state': 'absent'}}, - 'l': [{'y1': {'state': 'absent'}}], - 'z1': {'a': {'state': 'absent'}, 'b': {}, 'c': 42}, - 'empty': []} - - obj = cleanup_absent_fields(obj) - - assert 'y' not in obj - assert 'z' not in obj - assert 'l' not in obj - assert 'z1' in obj - assert 'b' not in obj['z1'] - assert 'a' not in obj['z1'] - assert 'empty' not in obj - - def test_complex_obj(self): - - obj = { - 'lb_algorithm': 'LB_ALGORITHM_ROUND_ROBIN', - 'use_service_port': False, 'server_auto_scale': False, - 'host_check_enabled': False, - 'tenant_ref': 'https://192.0.2.42/api/tenant/admin#admin', - 'capacity_estimation': False, - 'servers': [{ - 'hostname': 'grastogi-server6', 'ratio': 1, - 'ip': {'type': 'V4', 'addr': '198.51.100.62'}, - 'discovered_networks': [{ - 'subnet': [{ - 'ip_addr': { - 'type': 'V4', - 'addr': '198.51.100.0' - }, - 'mask': 24 - }], - 'network_ref': 'https://192.0.2.42/api/network/dvportgroup-53975-10.10.2.10#PG-964' - }], - 'enabled': True, 'nw_ref': 'https://192.0.2.42/api/vimgrnwruntime/dvportgroup-53975-10.10.2.10#PG-964', - 'verify_network': False, - 'static': False, - 'resolve_server_by_dns': False, - 'external_uuid': 'vm-4230615e-bc0b-3d33-3929-1c7328575993', - 'vm_ref': 'https://192.0.2.42/api/vimgrvmruntime/vm-4230615e-bc0b-3d33-3929-1c7328575993#grastogi-server6' - }, { - 'hostname': 'grastogi-server6', - 'ratio': 1, - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.61' - }, - 'discovered_networks': [{ - 'subnet': [{ - 'ip_addr': { - 'type': 'V4', - 'addr': '198.51.100.0' - }, - 'mask': 24 - }], - 'network_ref': 'https://192.0.2.42/api/network/dvportgroup-53975-10.10.2.10#PG-964' - }], - 'enabled': True, - 'nw_ref': 'https://192.0.2.42/api/vimgrnwruntime/dvportgroup-53975-10.10.2.10#PG-964', - 'verify_network': False, - 'static': False, - 'resolve_server_by_dns': False, - 'external_uuid': 'vm-4230615e-bc0b-3d33-3929-1c7328575993', - 'vm_ref': 'https://192.0.2.42/api/vimgrvmruntime/vm-4230615e-bc0b-3d33-3929-1c7328575993#grastogi-server6' - }, { - 'hostname': 'grastogi-server6', - 'ratio': 1, - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.65' - }, - 'discovered_networks': [{ - 'subnet': [{ - 'ip_addr': { - 'type': 'V4', - 'addr': '198.51.100.0' - }, 'mask': 24 - }], - 'network_ref': 'https://192.0.2.42/api/network/dvportgroup-53975-10.10.2.10#PG-964' - }], - 'enabled': True, - 'verify_network': False, - 'static': False, - 'resolve_server_by_dns': False - }], - 'fewest_tasks_feedback_delay': 10, - '_last_modified': '1473292763246107', - 'cloud_ref': 'https://192.0.2.42/api/cloud/cloud-e0696a58-8b72-4026-923c-9a87c38a2489#Default-Cloud', - 'vrf_ref': 'https://192.0.2.42/api/vrfcontext/vrfcontext-33dfbcd7-867c-4e3e-acf7-96bf679d5a0d#global', - 'inline_health_monitor': True, - 'default_server_port': 8000, - 'request_queue_depth': 128, - 'graceful_disable_timeout': 1, - 'sni_enabled': True, - 'server_count': 3, - 'uuid': 'pool-09201181-747e-41ea-872d-e9a7df71b726', - 'request_queue_enabled': False, - 'name': 'p1', - 'max_concurrent_connections_per_server': 0, - 'url': 'https://192.0.2.42/api/pool/pool-09201181-747e-41ea-872d-e9a7df71b726#p1', - 'enabled': True, - 'connection_ramp_duration': 10} - - existing_obj = { - 'lb_algorithm': 'LB_ALGORITHM_ROUND_ROBIN', - 'use_service_port': False, - 'server_auto_scale': False, - 'host_check_enabled': False, - 'tenant_ref': 'https://192.0.2.42/api/tenant/admin', - 'capacity_estimation': False, - 'servers': [{ - 'hostname': 'grastogi-server6', 'ratio': 1, - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.62' - }, - 'discovered_networks': [{ - 'subnet': [{ - 'mask': 24, - 'ip_addr': { - 'type': 'V4', - 'addr': '198.51.100.0' - } - }], - 'network_ref': 'https://192.0.2.42/api/network/dvportgroup-53975-10.10.2.10' - }], - 'enabled': True, - 'nw_ref': 'https://192.0.2.42/api/vimgrnwruntime/dvportgroup-53975-10.10.2.10', - 'verify_network': False, - 'static': False, - 'resolve_server_by_dns': False, - 'external_uuid': 'vm-4230615e-bc0b-3d33-3929-1c7328575993', - 'vm_ref': 'https://192.0.2.42/api/vimgrvmruntime/vm-4230615e-bc0b-3d33-3929-1c7328575993' - }, { - 'hostname': 'grastogi-server6', - 'ratio': 1, - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.61' - }, - 'discovered_networks': [{ - 'subnet': [{ - 'mask': 24, - 'ip_addr': { - 'type': 'V4', - 'addr': '198.51.100.0' - } - }], - 'network_ref': 'https://192.0.2.42/api/network/dvportgroup-53975-10.10.2.10' - }], - 'enabled': True, - 'nw_ref': 'https://192.0.2.42/api/vimgrnwruntime/dvportgroup-53975-10.10.2.10', - 'verify_network': False, - 'static': False, - 'resolve_server_by_dns': False, - 'external_uuid': 'vm-4230615e-bc0b-3d33-3929-1c7328575993', - 'vm_ref': 'https://192.0.2.42/api/vimgrvmruntime/vm-4230615e-bc0b-3d33-3929-1c7328575993' - }, { - 'hostname': 'grastogi-server6', - 'ratio': 1, - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.65' - }, - 'discovered_networks': [{ - 'subnet': [{ - 'mask': 24, - 'ip_addr': { - 'type': 'V4', - 'addr': '198.51.100.0' - } - }], - 'network_ref': 'https://192.0.2.42/api/network/dvportgroup-53975-10.10.2.10' - }], - 'enabled': True, - 'nw_ref': 'https://192.0.2.42/api/vimgrnwruntime/dvportgroup-53975-10.10.2.10', - 'verify_network': False, - 'static': False, - 'resolve_server_by_dns': False, - 'external_uuid': 'vm-4230615e-bc0b-3d33-3929-1c7328575993', - 'vm_ref': 'https://192.0.2.42/api/vimgrvmruntime/vm-4230615e-bc0b-3d33-3929-1c7328575993' - }], - 'fewest_tasks_feedback_delay': 10, - 'cloud_ref': 'https://192.0.2.42/api/cloud/cloud-e0696a58-8b72-4026-923c-9a87c38a2489', - 'vrf_ref': 'https://192.0.2.42/api/vrfcontext/vrfcontext-33dfbcd7-867c-4e3e-acf7-96bf679d5a0d', - 'inline_health_monitor': True, - 'default_server_port': 8000, - 'request_queue_depth': 128, - 'graceful_disable_timeout': 1, - 'sni_enabled': True, - 'server_count': 3, - 'uuid': 'pool-09201181-747e-41ea-872d-e9a7df71b726', - 'request_queue_enabled': False, - 'name': 'p1', - 'max_concurrent_connections_per_server': 0, - 'url': 'https://192.0.2.42/api/pool/pool-09201181-747e-41ea-872d-e9a7df71b726', - 'enabled': True, - 'connection_ramp_duration': 10 - } - - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - def testAWSVs(self): - existing_obj = { - 'network_profile_ref': 'https://12.97.16.202/api/networkprofile/networkprofile-9a0a9896-6876-44c8-a3ee-512a968905f2#System-TCP-Proxy', - 'port_uuid': 'eni-4144e73c', - 'weight': 1, - 'availability_zone': 'us-west-2a', - 'enabled': True, - 'flow_dist': 'LOAD_AWARE', - 'subnet_uuid': 'subnet-91f0b6f4', - 'delay_fairness': False, - 'avi_allocated_vip': True, - 'vrf_context_ref': 'https://12.97.16.202/api/vrfcontext/vrfcontext-722b280d-b555-4d82-9b35-af9442c0cb86#global', - 'subnet': { - 'ip_addr': { - 'type': 'V4', - 'addr': '198.51.100.0' - }, - 'mask': 24 - }, - 'cloud_type': 'CLOUD_AWS', 'uuid': 'virtualservice-a5f49b99-22c8-42e6-aa65-3ca5f1e36b9e', - 'network_ref': 'https://12.97.16.202/api/network/subnet-91f0b6f4', - 'cloud_ref': 'https://12.97.16.202/api/cloud/cloud-49829414-c704-43ca-9dff-05b9e8474dcb#AWS Cloud', - 'avi_allocated_fip': False, - 'se_group_ref': 'https://12.97.16.202/api/serviceenginegroup/serviceenginegroup-3bef6320-5a2d-4801-85c4-ef4f9841f235#Default-Group', - 'scaleout_ecmp': False, - 'max_cps_per_client': 0, - 'type': 'VS_TYPE_NORMAL', - 'analytics_profile_ref': 'https://12.97.16.202/api/analyticsprofile/analyticsprofile-70f8b06f-7b6a-4500-b829-c869bbca2009#System-Analytics-Profile', - 'use_bridge_ip_as_vip': False, - 'application_profile_ref': 'https://12.97.16.202/api/applicationprofile/applicationprofile-103cbc31-cac5-46ab-8e66-bbbb2c8f551f#System-HTTP', - 'auto_allocate_floating_ip': False, - 'services': [{ - 'enable_ssl': False, - 'port_range_end': 80, - 'port': 80 - }], - 'active_standby_se_tag': 'ACTIVE_STANDBY_SE_1', - 'ip_address': { - 'type': 'V4', - 'addr': '198.51.100.33' - }, - 'ign_pool_net_reach': False, - 'east_west_placement': False, - 'limit_doser': False, - 'name': 'wwwawssit.ebiz.verizon.com', - 'url': 'https://12.97.16.202/api/virtualservice/virtualservice-a5f49b99-22c8-42e6-aa65-3ca5f1e36b9e#wwwawssit.ebiz.verizon.com', - 'ssl_sess_cache_avg_size': 1024, - 'enable_autogw': True, - 'auto_allocate_ip': True, - 'tenant_ref': 'https://12.97.16.202/api/tenant/tenant-f52f7a3e-6876-4bb9-b8f7-3cab636dadf2#Sales', - 'remove_listening_port_on_vs_down': False - } - obj = {'auto_allocate_ip': True, 'subnet_uuid': 'subnet-91f0b6f4', 'cloud_ref': '/api/cloud?name=AWS Cloud', 'services': [{'port': 80}], - 'name': 'wwwawssit.ebiz.verizon.com'} - - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - def testhttppolicy(self): - existing_obj = { - "http_request_policy": { - "rules": [{ - "enable": True, - "index": 0, - "match": { - "path": { - "match_case": "INSENSITIVE", - "match_criteria": "CONTAINS", - "match_str": ["xvz", "rst"] - } - }, - "name": "blah", - "switching_action": { - "action": "HTTP_SWITCHING_SELECT_POOL", - "pool_ref": "https://12.97.16.202/api/pool/pool-d7f6f5e7-bd26-49ad-aeed-965719eb140b#abc", - "status_code": "HTTP_LOCAL_RESPONSE_STATUS_CODE_200" - } - }] - }, - "is_internal_policy": False, - "name": "blah", - "tenant_ref": "https://12.97.16.202/api/tenant/tenant-f52f7a3e-6876-4bb9-b8f7-3cab636dadf2#Sales", - "url": "https://12.97.16.202/api/httppolicyset/httppolicyset-ffd8354b-671b-48d5-92cc-69a9057aad0c#blah", - "uuid": "httppolicyset-ffd8354b-671b-48d5-92cc-69a9057aad0c" - } - - obj = { - "http_request_policy": { - "rules": [{ - "enable": True, - "index": "0", - "match": { - "path": { - "match_case": "INSENSITIVE", - "match_criteria": "CONTAINS", - "match_str": ["xvz", "rst"] - } - }, - "name": "blah", - "switching_action": { - "action": "HTTP_SWITCHING_SELECT_POOL", - "pool_ref": "/api/pool?name=abc", - "status_code": "HTTP_LOCAL_RESPONSE_STATUS_CODE_200" - } - }] - }, - "is_internal_policy": False, - "tenant": "Sales" - } - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - def testCleanupFields(self): - obj = {'name': 'testpool', - 'scalar_field': {'state': 'absent'}, - 'list_fields': [{'x': '1'}, {'y': {'state': 'absent'}}]} - - cleanup_absent_fields(obj) - assert 'scalar_field' not in obj - for elem in obj['list_fields']: - assert 'y' not in elem - - def testGSLB(self): - obj = { - 'domain_names': ['cloud5.avi.com', 'cloud6.avi.com'], - 'health_monitor_scope': 'GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS', - 'groups': [{ - 'priority': 20, - 'members': [{ - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.1' - }, - 'enabled': True, 'ratio': 1 - }, { - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.10' - }, - 'enabled': True, - 'ratio': 1 - }], - 'algorithm': 'GSLB_ALGORITHM_CONSISTENT_HASH', - 'name': 'sc' - }, { - 'priority': 14, - 'members': [{ - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.2' - }, - 'enabled': True, - 'ratio': 1 - }], - 'algorithm': 'GSLB_ALGORITHM_ROUND_ROBIN', - 'name': 'cn' - }, { - 'priority': 15, - 'members': [{ - 'ip': { - 'type': 'V4', - 'addr': '198.51.100.3' - }, - 'enabled': True, 'ratio': 1 - }], - 'algorithm': 'GSLB_ALGORITHM_ROUND_ROBIN', - 'name': 'in' - }], - 'name': 'gs-3', - 'num_dns_ip': 2 - } - existing_obj = { - u'controller_health_status_enabled': True, - u'uuid': u'gslbservice-ab9b36bd-3e95-4c2e-80f8-92905c2eccb2', - u'wildcard_match': False, - u'url': u'https://192.0.2.42/api/gslbservice/gslbservice-ab9b36bd-3e95-4c2e-80f8-92905c2eccb2#gs-3', - u'tenant_ref': u'https://192.0.2.42/api/tenant/admin#admin', - u'enabled': True, - u'domain_names': [u'cloud5.avi.com', u'cloud6.avi.com'], - u'use_edns_client_subnet': True, - u'groups': [{ - u'priority': 20, - u'members': [{ - u'ip': { - u'type': u'V4', - u'addr': u'198.51.100.1' - }, - u'ratio': 1, - u'enabled': True - }, { - u'ip': { - u'type': u'V4', - u'addr': u'198.51.100.10' - }, - u'ratio': 1, - u'enabled': True - }], - u'name': u'sc', - u'algorithm': u'GSLB_ALGORITHM_CONSISTENT_HASH' - }, { - u'priority': 14, - u'members': [{ - u'ip': { - u'type': u'V4', - u'addr': u'198.51.100.2' - }, - u'ratio': 1, - u'enabled': True - }], - u'name': u'cn', - u'algorithm': u'GSLB_ALGORITHM_ROUND_ROBIN' - }, { - u'priority': 15, - u'members': [{ - u'ip': { - u'type': u'V4', - u'addr': u'198.51.100.3' - }, - u'ratio': 1, - u'enabled': True - }], - u'name': u'in', - u'algorithm': u'GSLB_ALGORITHM_ROUND_ROBIN' - }], - u'num_dns_ip': 2, - u'health_monitor_scope': u'GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS', - u'name': u'gs-3' - } - diff = avi_obj_cmp(obj, existing_obj) - assert diff - - def testNoneParams(self): - objwnone = { - 'name': 'testpool', - 'scalar_field': None, - 'list_fields': { - 'y': None, - 'z': 'zz' - } - } - obj = { - 'name': 'testpool', - 'list_fields': { - 'z': 'zz' - } - } - - result = avi_obj_cmp(objwnone, obj) - assert result diff --git a/tests/unit/plugins/modules/network/avi/__init__.py b/tests/unit/plugins/modules/network/avi/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/plugins/modules/network/avi/fixtures/avi_user.json b/tests/unit/plugins/modules/network/avi/fixtures/avi_user.json deleted file mode 100644 index 85522c32..00000000 --- a/tests/unit/plugins/modules/network/avi/fixtures/avi_user.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "mock_create_res": { - "ansible_facts": { - "avi_api_context": { - "192.0.2.97:admin:None": { - "csrftoken": "qG23CCARDL3rh1KZ66XXPIeUYCUCOZ4q", - "session_id": "h5nynf9u9nompp5byai7vii2v8bbn9kd" - } - } - }, - "api_context": null, - "changed": true, - "invocation": { - "module_args": { - "access": [{ - "role_ref": "/api/role?name=Tenant-Admin", - "tenant_ref": "/api/tenant/********#********", - "all_tenants": false - }], - "api_context": null, - "api_version": "18.2.5", - "avi_api_update_method": "put", - "avi_credentials": null, - "avi_disable_session_cache_as_fact": false, - "avi_login_info": null, - "controller": "192.0.2.97", - "default_tenant_ref": "/api/tenant?name=********", - "email": "test@abc.com", - "is_active": true, - "is_superuser": true, - "name": "testuser", - "obj_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "obj_username": "testuser", - "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "state": "present", - "tenant": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "tenant_uuid": "", - "user_profile_ref": "/api/useraccountprofile?name=Default-User-Account-Profile", - "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER" - } - }, - "obj": { - "_last_modified": "1559736767460818", - "access": [{ - "all_tenants": false, - "role_ref": "https://192.0.2.97/api/tenant/********/role/role-ff851004-bd75-485b-87ec-2fe1d6a03fb9#Tenant-Admin", - "tenant_ref": "https://192.0.2.97/api/tenant/********#********" - }], - "default_tenant_ref": "https://192.0.2.97/api/tenant/********#********", - "email": "test@abc.com", - "full_name": "testuser", - "is_active": true, - "is_superuser": true, - "local": true, - "name": "testuser", - "obj_password": "", - "obj_username": "testuser", - "password": "", - "uid": 2004, - "url": "https://192.0.2.97/api/user/user-7087578f-4dfe-4e06-a153-495a91824a1d#testuser", - "user_profile_ref": "https://192.0.2.97/api/useraccountprofile/useraccountprofile-78063e7c-b443-48d6-b34c-5253ae1fcd2a#Default-User-Account-Profile", - "username": "testuser", - "uuid": "user-7087578f-4dfe-4e06-a153-495a91824a1d" - }, - "old_obj": null - }, - "mock_put_res": { - "obj": { - "username": "testuser", - "user_profile_ref": "https://192.0.2.97/api/useraccountprofile/useraccountprofile-546c5e88-6270-4ba1-9cfd-d0c755e68f47#Default-User-Account-Profile", - "name": "testuser", - "url": "https://192.0.2.97/api/user/user-ed10f328-bd92-4db2-bacd-0cf795fcbf8a#testuser", - "is_active": true, - "uuid": "user-ed10f328-bd92-4db2-bacd-0cf795fcbf8a", - "email": "newemail@abc.com", - "access": [{ - "tenant_ref": "https://192.0.2.97/api/tenant/tenant-57af0f3f-6f14-4657-8f32-9b289407752b#Test-Admin", - "all_tenants": false, - "role_ref": "https://192.0.2.97/api/tenant/********/role/role-b073ab0d-e1d0-4800-95ef-6ecf2c5ed7d1#Tenant-Admin" - }], - "is_superuser": true, - "obj_username": "testuser", - "full_name": "testuser", - "_last_modified": "1559802772203285", - "password": "", - "local": true, - "obj_password": "", - "default_tenant_ref": "https://192.0.2.97/api/tenant/********#********", - "uid": 2002 - }, - "changed": true, - "api_context": null, - "invocation": { - "module_args": { - "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "user_profile_ref": "/api/useraccountprofile?name=Default-User-Account-Profile", - "api_version": "18.2.5", - "name": "testuser", - "state": "present", - "is_active": true, - "api_context": null, - "avi_disable_session_cache_as_fact": false, - "controller": "192.0.2.97", - "avi_api_patch_op": null, - "access": [{ - "tenant_ref": "/api/tenant?name=Test-Admin", - "all_tenants": false, - "role_ref": "/api/role?name=Tenant-Admin" - }], - "is_superuser": true, - "avi_credentials": null, - "email": "newemail@abc.com", - "default_tenant_ref": "/api/tenant?name=********", - "obj_username": "testuser", - "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "tenant_uuid": "", - "obj_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "avi_api_update_method": "put", - "tenant": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER" - } - }, - "ansible_facts": { - "avi_api_context": { - "192.0.2.97:admin:None": { - "csrftoken": "Y7CET6zaIC9VZAzBqEW4cWo1N26jPg55", - "session_id": "364n7o0p3o5so63b9rzd47v6ehya6xg7" - } - } - }, - "old_obj": { - "username": "testuser", - "user_profile_ref": "https://192.0.2.97/api/useraccountprofile/useraccountprofile-546c5e88-6270-4ba1-9cfd-d0c755e68f47#Default-User-Account-Profile", - "name": "testuser", - "url": "https://192.0.2.97/api/user/user-ed10f328-bd92-4db2-bacd-0cf795fcbf8a#testuser", - "is_active": true, - "uuid": "user-ed10f328-bd92-4db2-bacd-0cf795fcbf8a", - "access": [{ - "tenant_ref": "https://192.0.2.97/api/tenant/tenant-57af0f3f-6f14-4657-8f32-9b289407752b#Test-Admin", - "all_tenants": false, - "role_ref": "https://192.0.2.97/api/tenant/********/role/role-b073ab0d-e1d0-4800-95ef-6ecf2c5ed7d1#Tenant-Admin" - }], - "is_superuser": true, - "full_name": "testuser", - "ui_property": "", - "password": "", - "local": true, - "email": "test@abc.com", - "default_tenant_ref": "https://192.0.2.97/api/tenant/********#********", - "uid": 2002 - } - }, - "mock_del_res": { - "ansible_facts": { - "avi_api_context": { - "192.0.2.97:admin:None": { - "csrftoken": "Vtkx9GeS2lsrld5yX83cmJqbZO3MAimb", - "session_id": "ix3t1dja8yzwb155de59viyn96hibn6b" - } - } - }, - "api_context": null, - "changed": true, - "invocation": { - "module_args": { - "access": [{ - "role_ref": "/api/role?name=Tenant-Admin", - "tenant_ref": "/api/tenant/********#********" - }], - "api_context": null, - "api_version": "18.2.5", - "avi_api_update_method": "put", - "avi_credentials": null, - "avi_disable_session_cache_as_fact": false, - "avi_login_info": null, - "controller": "192.0.2.97", - "default_tenant_ref": "/api/tenant?name=********", - "email": "test@abc.com", - "is_active": true, - "is_superuser": true, - "name": "testuser", - "obj_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "obj_username": "testuser", - "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "state": "absent", - "tenant": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", - "tenant_uuid": "", - "user_profile_ref": "/api/useraccountprofile?name=Default-User-Account-Profile", - "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER" - } - }, - "obj": null, - "old_obj": { - "_last_modified": "1559803346264869", - "access": [{ - "all_tenants": false, - "role_ref": "https://192.0.2.97/api/tenant/********/role/role-b073ab0d-e1d0-4800-95ef-6ecf2c5ed7d1#Tenant-Admin", - "tenant_ref": "https://192.0.2.97/api/tenant/tenant-57af0f3f-6f14-4657-8f32-9b289407752b#Test-Admin" - }], - "default_tenant_ref": "https://192.0.2.97/api/tenant/********#********", - "email": "newemail@abc.com", - "full_name": "testuser", - "is_active": true, - "is_superuser": true, - "local": true, - "name": "testuser", - "password": "", - "ui_property": "", - "uid": 2002, - "url": "https://192.0.2.97/api/user/user-ed10f328-bd92-4db2-bacd-0cf795fcbf8a#testuser", - "user_profile_ref": "https://192.0.2.97/api/useraccountprofile/useraccountprofile-546c5e88-6270-4ba1-9cfd-d0c755e68f47#Default-User-Account-Profile", - "username": "testuser", - "uuid": "user-ed10f328-bd92-4db2-bacd-0cf795fcbf8a" - } - } -} diff --git a/tests/unit/plugins/modules/network/avi/test_avi_user.py b/tests/unit/plugins/modules/network/avi/test_avi_user.py deleted file mode 100644 index 97ee0de3..00000000 --- a/tests/unit/plugins/modules/network/avi/test_avi_user.py +++ /dev/null @@ -1,104 +0,0 @@ -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -import os -import json -from ansible_collections.community.network.tests.unit.compat import unittest -from ansible_collections.community.network.tests.unit.compat.mock import Mock -from ansible_collections.community.network.tests.unit.plugins.modules.utils import set_module_args -from ansible_collections.community.network.plugins.modules.network.avi import avi_user - -fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') -with open(fixture_path + '/avi_user.json') as json_file: - data = json.load(json_file) - - -class TestAviUser(unittest.TestCase): - - def test_create_user(self): - set_module_args({ - "avi_credentials": { - "controller": "192.0.2.13", - "username": "username", - "password": "fakepassword", - "api_version": "18.2.5" - }, - "state": "present", - "name": "testuser", - "obj_username": "testuser", - "obj_password": "test123", - "email": "test@abc.com", - "access": [ - { - "role_ref": "/api/role?name=Tenant-Admin", - "tenant_ref": "/api/tenant?name=Test-Admin", - "all_tenants": False - } - ], - "user_profile_ref": "/api/useraccountprofile?name=Default-User-Account-Profile", - "is_active": True, - "is_superuser": True, - "default_tenant_ref": "/api/tenant?name=admin" - }) - avi_user.avi_ansible_api = Mock(return_value=data['mock_create_res']) - response = avi_user.main() - assert response['changed'] - - def test_put_on_user(self): - set_module_args({ - "avi_credentials": { - "controller": "192.0.2.13", - "username": "username", - "password": "fakepassword", - "api_version": "18.2.5" - }, - "state": "present", - "avi_api_update_method": "put", - "name": "testuser", - "obj_username": "testuser", - "obj_password": "test123", - "email": "newemail@abc.com", - "access": [{ - "role_ref": "/api/role?name=Tenant-Admin", - "tenant_ref": "/api/tenant?name=Test-Admin", - "all_tenants": False - }], - "user_profile_ref": "/api/useraccountprofile?name=Default-User-Account-Profile", - "is_active": True, - "is_superuser": True, - "default_tenant_ref": "/api/tenant?name=admin" - }) - avi_user.avi_ansible_api = Mock(return_value=data['mock_put_res']) - response = avi_user.main() - assert response['changed'] - assert response['obj'] - assert response['old_obj'] - - def test_delete_user(self): - set_module_args({ - "avi_credentials": { - "controller": "192.0.2.13", - "username": "username", - "password": "fakepassword", - "api_version": "18.2.5" - - }, - "name": "testuser", - "obj_username": "testuser", - "obj_password": "test123", - "email": "test@abc.com", - "access": [{ - "role_ref": "/api/role?name=Tenant-Admin", - "tenant_ref": "/api/tenant?name=Test-Admin", - "all_tenants": False - }], - "user_profile_ref": "/api/useraccountprofile?name=Default-User-Account-Profile", - "is_active": True, - "is_superuser": True, - "default_tenant_ref": "/api/tenant?name=admin" - }) - avi_user.avi_ansible_api = Mock(return_value=data['mock_del_res']) - response = avi_user.main() - assert response['changed'] - assert not response['obj'] - assert response['old_obj']