Updated utils to remove Avi SDK dependency and Avi 18.2.2 version update (#54894)

* Updated utils to remove Avi SDK dependency and Avi 18.2.2 version update

* Fixed the python 3.x errors failing for avi_disable_session_cache_as_fact not properly documented

* Updated version added fields for new parameters

* fixed pep8 errors

* made requests import optional

* removed setting requests to None

* Added try catch for the avi helper methods such that any import fails then module fail gracefully. This was needed to pass the requests library not found error

* removed deprecated modules. Also, trying another fix to deal with requests import error

* Fixed python3 errors

* fixed pep8, no-dict-iteritems and import test failures

* added version 2.8 for new field

* some more code cleanup and formatting

* updated the fail message and fixed plint errors

* added workaround for unicode pylint

* fixed the version added for new parameter app_learning_memory_percent and removed unicode_literals import

* Removed check of HAS_AVI for common argument spec

* Updated version added value from 2.8 to 2.9

* Version added value fixes of CI error
This commit is contained in:
Chaitanya Deshpande
2019-05-17 22:42:06 +05:30
committed by Nathaniel Case
parent 63e33f7e71
commit b5935486da
72 changed files with 2906 additions and 980 deletions

View File

@@ -61,7 +61,13 @@ options:
description:
- Allowed values are 0-1440.
- Default value when not specified in API or module is interpreted by Avi Controller as 15.
- Units(MIN).
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.
version_added: "2.9"
appviewx_compat_mode:
description:
- Export configuration in appviewx compatibility mode.
@@ -72,7 +78,6 @@ options:
description:
- Number of attach_ip_retry_interval.
- Default value when not specified in API or module is interpreted by Avi Controller as 360.
- Units(SEC).
attach_ip_retry_limit:
description:
- Number of attach_ip_retry_limit.
@@ -84,29 +89,57 @@ options:
- Default value when not specified in API or module is interpreted by Avi Controller as True.
version_added: "2.5"
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.
version_added: "2.9"
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.
version_added: "2.9"
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.
version_added: "2.9"
type: bool
cluster_ip_gratuitous_arp_period:
description:
- Number of cluster_ip_gratuitous_arp_period.
- Period for cluster ip gratuitous arp job.
- Default value when not specified in API or module is interpreted by Avi Controller as 60.
- Units(MIN).
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.
version_added: "2.9"
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.
- Units(SEC).
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.
- Units(SEC).
dns_refresh_period:
description:
- Number of dns_refresh_period.
- Period for refresh pool and gslb dns job.
- Default value when not specified in API or module is interpreted by Avi Controller as 60.
- Units(MIN).
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.
version_added: "2.9"
type: bool
enable_memory_balancer:
description:
- Enable/disable memory balancer.
@@ -118,7 +151,6 @@ options:
description:
- Number of fatal_error_lease_time.
- Default value when not specified in API or module is interpreted by Avi Controller as 120.
- Units(SEC).
max_dead_se_in_grp:
description:
- Number of max_dead_se_in_grp.
@@ -139,20 +171,31 @@ options:
- 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 60.
- Units(MIN).
- 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.
version_added: "2.4"
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.
version_added: "2.9"
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.
version_added: "2.9"
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.
- Units(SEC).
safenet_hsm_version:
description:
- Version of the safenet package installed on the controller.
@@ -162,37 +205,38 @@ options:
description:
- Number of se_create_timeout.
- Default value when not specified in API or module is interpreted by Avi Controller as 900.
- Units(SEC).
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.
- Units(SEC).
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.
version_added: "2.9"
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.
- Units(SEC).
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.
- Units(SEC).
secure_channel_cleanup_timeout:
description:
- Number of secure_channel_cleanup_timeout.
- Period for secure channel cleanup job.
- Default value when not specified in API or module is interpreted by Avi Controller as 60.
- Units(MIN).
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.
- Units(MIN).
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.
- Units(MIN).
seupgrade_fabric_pool_size:
description:
- Pool size used for all fabric commands during se upgrade.
@@ -201,28 +245,23 @@ options:
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.
- Units(SEC).
ssl_certificate_expiry_warning_days:
description:
- Number of days for ssl certificate expiry warning.
- Units(DAYS).
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.
- Units(SEC).
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.
- Units(SEC).
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.
- Units(SEC).
url:
description:
- Avi controller URL of the object.
@@ -233,60 +272,62 @@ options:
description:
- Number of vnic_op_fail_time.
- Default value when not specified in API or module is interpreted by Avi Controller as 180.
- Units(SEC).
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.
- Units(SEC).
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.
- Units(SEC).
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.
- Units(MIN).
version_added: "2.9"
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 3600.
- Units(SEC).
- Default value when not specified in API or module is interpreted by Avi Controller as 600.
version_added: "2.5"
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.
- Units(SEC).
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.
- Units(SEC).
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.
- Units(SEC).
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.
- Units(SEC).
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.
- Units(SEC).
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.
- Units(SEC).
version_added: "2.9"
extends_documentation_fragment:
- avi
'''
@@ -311,7 +352,7 @@ obj:
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.network.avi.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
avi_common_argument_spec, avi_ansible_api, HAS_AVI)
except ImportError:
HAS_AVI = False
@@ -327,15 +368,21 @@ def main():
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',),
@@ -344,10 +391,13 @@ def main():
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',),
@@ -365,6 +415,7 @@ def main():
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',),
@@ -372,13 +423,14 @@ def main():
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) is not installed. '
'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']))