From 608a8486e35f8792b4da12c4a9c9ad851469695f Mon Sep 17 00:00:00 2001 From: Chris Hawk Date: Tue, 5 Nov 2024 14:58:14 -0800 Subject: [PATCH] Fix many documentation lint errors --- .../modules/gcp_compute_backend_service.py | 12 ++- .../gcp_compute_backend_service_info.py | 2 +- plugins/modules/gcp_compute_health_check.py | 1 - .../gcp_compute_region_backend_service.py | 5 +- ...gcp_compute_region_backend_service_info.py | 2 +- .../gcp_compute_region_health_check.py | 1 - plugins/modules/gcp_compute_region_url_map.py | 13 --- plugins/modules/gcp_compute_reservation.py | 1 - plugins/modules/gcp_compute_url_map.py | 27 ++---- plugins/modules/gcp_kms_crypto_key.py | 1 + plugins/modules/gcp_redis_instance.py | 1 - .../gcp_resourcemanager_project_info.py | 2 +- plugins/modules/gcp_secret_manager.py | 85 +++++++++++-------- plugins/modules/gcp_sql_user_info.py | 2 +- .../modules/gcp_storage_default_object_acl.py | 4 + plugins/modules/gcp_storage_object.py | 1 - plugins/modules/gcp_tpu_node.py | 1 - 17 files changed, 75 insertions(+), 86 deletions(-) diff --git a/plugins/modules/gcp_compute_backend_service.py b/plugins/modules/gcp_compute_backend_service.py index e311fcc..6339e6e 100644 --- a/plugins/modules/gcp_compute_backend_service.py +++ b/plugins/modules/gcp_compute_backend_service.py @@ -422,6 +422,11 @@ options: elements: str required: false type: list + fingerprint: + description: + - Fingerprint of this resource. A hash of the contents stored in this object. This + field is used in optimistic locking. + type: str description: description: - An optional description of this resource. @@ -478,7 +483,7 @@ options: - The load balancing algorithm used within the scope of the locality. - The possible values are - * ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. - - "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts + - "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and picks the host which has fewer active requests." - "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host @@ -566,6 +571,7 @@ options: be used to disable ejection or to ramp it up slowly. Defaults to 0. required: false type: int + default: 0 enforcing_success_rate: description: - The percentage chance that a host will be actually ejected when an outlier @@ -1210,7 +1216,7 @@ localityLbPolicy: - The load balancing algorithm used within the scope of the locality. - The possible values are - * ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. - - "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts and + - "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and picks the host which has fewer active requests." - "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host @@ -1442,7 +1448,7 @@ def main(): # TODO: capacity_scaler does some value normalization # server-side, so there needs to be a way to do proper # value comparison. - capacity_scaler=dict(default="1", type="str"), + capacity_scaler=dict(default="1.0", type="str"), description=dict(type="str"), group=dict(required=True, type="str"), max_connections=dict(type="int"), diff --git a/plugins/modules/gcp_compute_backend_service_info.py b/plugins/modules/gcp_compute_backend_service_info.py index c16f657..54171d6 100644 --- a/plugins/modules/gcp_compute_backend_service_info.py +++ b/plugins/modules/gcp_compute_backend_service_info.py @@ -549,7 +549,7 @@ resources: - The load balancing algorithm used within the scope of the locality. - The possible values are - * ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. - - "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts + - "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and picks the host which has fewer active requests." - "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a diff --git a/plugins/modules/gcp_compute_health_check.py b/plugins/modules/gcp_compute_health_check.py index ca4c642..54ab300 100644 --- a/plugins/modules/gcp_compute_health_check.py +++ b/plugins/modules/gcp_compute_health_check.py @@ -457,7 +457,6 @@ options: - Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. required: false - default: 'false' type: bool project: description: diff --git a/plugins/modules/gcp_compute_region_backend_service.py b/plugins/modules/gcp_compute_region_backend_service.py index b01a4f5..832cfe5 100644 --- a/plugins/modules/gcp_compute_region_backend_service.py +++ b/plugins/modules/gcp_compute_region_backend_service.py @@ -476,7 +476,7 @@ options: - The load balancing algorithm used within the scope of the locality. - The possible values are - * ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. - - "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts + - "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and picks the host which has fewer active requests." - "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host @@ -566,6 +566,7 @@ options: be used to disable ejection or to ramp it up slowly. Defaults to 0. required: false type: int + default: 0 enforcing_success_rate: description: - The percentage chance that a host will be actually ejected when an outlier @@ -1222,7 +1223,7 @@ localityLbPolicy: - The load balancing algorithm used within the scope of the locality. - The possible values are - * ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. - - "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts and + - "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and picks the host which has fewer active requests." - "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host diff --git a/plugins/modules/gcp_compute_region_backend_service_info.py b/plugins/modules/gcp_compute_region_backend_service_info.py index 4f5ba3b..99c2b75 100644 --- a/plugins/modules/gcp_compute_region_backend_service_info.py +++ b/plugins/modules/gcp_compute_region_backend_service_info.py @@ -559,7 +559,7 @@ resources: - The load balancing algorithm used within the scope of the locality. - The possible values are - * ROUND_ROBIN - This is a simple policy in which each healthy backend is selected in round robin order. - - "* LEAST_REQUEST - An O(1) algorithm which selects two random healthy hosts + - "* LEAST_REQUEST - An algorithm which selects two random healthy hosts and picks the host which has fewer active requests." - "* RING_HASH - The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a diff --git a/plugins/modules/gcp_compute_region_health_check.py b/plugins/modules/gcp_compute_region_health_check.py index fcbad21..2e489c1 100644 --- a/plugins/modules/gcp_compute_region_health_check.py +++ b/plugins/modules/gcp_compute_region_health_check.py @@ -452,7 +452,6 @@ options: - Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. required: false - default: 'false' type: bool region: description: diff --git a/plugins/modules/gcp_compute_region_url_map.py b/plugins/modules/gcp_compute_region_url_map.py index 1d8c9c3..9428488 100644 --- a/plugins/modules/gcp_compute_region_url_map.py +++ b/plugins/modules/gcp_compute_region_url_map.py @@ -302,7 +302,6 @@ options: is considered a match if the match criteria above are NOT met. Defaults to false. required: false - default: 'false' type: bool prefix_match: description: @@ -364,7 +363,6 @@ options: - Specifies that prefixMatch and fullPathMatch matches are case sensitive. - Defaults to false. required: false - default: 'false' type: bool metadata_filters: description: @@ -499,7 +497,6 @@ options: to the Access- Control-Allow-Credentials header. Defaults to false. required: false - default: 'false' type: bool allow_headers: description: @@ -535,7 +532,6 @@ options: - which indicates that the CORS policy is in effect. Defaults to false. required: false - default: 'false' type: bool expose_headers: description: @@ -882,7 +878,6 @@ options: used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. required: false - default: 'false' type: bool path_redirect: description: @@ -926,7 +921,6 @@ options: query portion of the original URL is retained. The default value is false. required: false - default: 'false' type: bool path_rules: description: @@ -993,7 +987,6 @@ options: to the Access- Control-Allow-Credentials header. Defaults to false. required: false - default: 'false' type: bool allow_headers: description: @@ -1373,7 +1366,6 @@ options: used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. required: false - default: 'false' type: bool path_redirect: description: @@ -1416,7 +1408,6 @@ options: is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. required: false - default: 'false' type: bool default_url_redirect: description: @@ -1441,7 +1432,6 @@ options: in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. required: false - default: 'false' type: bool path_redirect: description: @@ -1483,7 +1473,6 @@ options: removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. required: false - default: 'false' type: bool tests: description: @@ -1541,7 +1530,6 @@ options: Setting this true for TargetHttpsProxy is not permitted. The default is set to false. required: false - default: 'false' type: bool path_redirect: description: @@ -1582,7 +1570,6 @@ options: prior to redirecting the request. If set to false, the query portion of the original URL is retained. required: false - default: 'false' type: bool region: description: diff --git a/plugins/modules/gcp_compute_reservation.py b/plugins/modules/gcp_compute_reservation.py index c0a9dd0..b8cc710 100644 --- a/plugins/modules/gcp_compute_reservation.py +++ b/plugins/modules/gcp_compute_reservation.py @@ -73,7 +73,6 @@ options: this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false. required: false - default: 'false' type: bool specific_reservation: description: diff --git a/plugins/modules/gcp_compute_url_map.py b/plugins/modules/gcp_compute_url_map.py index 2856e59..f71ea3e 100644 --- a/plugins/modules/gcp_compute_url_map.py +++ b/plugins/modules/gcp_compute_url_map.py @@ -70,6 +70,11 @@ options: the resource. required: false type: str + fingerprint: + description: + - Fingerprint of this resource. A hash of the contents stored in this object. This + field is used in optimistic locking. + type: str header_action: description: - Specifies changes to request and response headers that need to take effect for @@ -357,7 +362,6 @@ options: to the Access- Control-Allow-Credentials header. Defaults to false. required: false - default: 'false' type: bool allow_headers: description: @@ -737,7 +741,6 @@ options: used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. required: false - default: 'false' type: bool path_redirect: description: @@ -780,7 +783,6 @@ options: is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. required: false - default: 'false' type: bool route_rules: description: @@ -948,7 +950,6 @@ options: is considered a match if the match criteria above are NOT met. Defaults to false. required: false - default: 'false' type: bool prefix_match: description: @@ -1010,7 +1011,6 @@ options: - Specifies that prefixMatch and fullPathMatch matches are case sensitive. - Defaults to false. required: false - default: 'false' type: bool metadata_filters: description: @@ -1145,7 +1145,6 @@ options: to the Access- Control-Allow-Credentials header. Defaults to false. required: false - default: 'false' type: bool allow_headers: description: @@ -1181,7 +1180,6 @@ options: - which indicates that the CORS policy is in effect. Defaults to false. required: false - default: 'false' type: bool expose_headers: description: @@ -1531,7 +1529,6 @@ options: - Setting this true for TargetHttpsProxy is not permitted. Defaults to false. required: false - default: 'false' type: bool path_redirect: description: @@ -1569,7 +1566,6 @@ options: is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. Defaults to false. required: false - default: 'false' type: bool default_url_redirect: description: @@ -1594,7 +1590,6 @@ options: in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. required: false - default: 'false' type: bool path_redirect: description: @@ -1636,7 +1631,6 @@ options: removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. required: false - default: 'false' type: bool default_route_action: description: @@ -1733,7 +1727,6 @@ options: - If true, headerValue is set for the header, discarding any values that were set for that header. required: false - default: 'false' type: bool response_headers_to_remove: description: @@ -1767,7 +1760,6 @@ options: - If true, headerValue is set for the header, discarding any values that were set for that header. required: false - default: 'false' type: bool url_rewrite: description: @@ -1960,14 +1952,12 @@ options: that the actual request can include user credentials. - This translates to the Access-Control-Allow-Credentials header. required: false - default: 'false' type: bool disabled: description: - If true, specifies the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect. required: false - default: 'false' type: bool fault_injection_policy: description: @@ -2095,7 +2085,6 @@ options: Setting this true for TargetHttpsProxy is not permitted. The default is set to false. required: false - default: 'false' type: bool path_redirect: description: @@ -2136,7 +2125,6 @@ options: prior to redirecting the request. If set to false, the query portion of the original URL is retained. The default is set to false. required: false - default: 'false' type: bool default_route_action: description: @@ -2231,8 +2219,6 @@ options: exist for the header. - If true, headerValue is set for the header, discarding any values that were set for that header. - required: false - default: 'false' type: bool response_headers_to_remove: description: @@ -2266,7 +2252,6 @@ options: - If true, headerValue is set for the header, discarding any values that were set for that header. required: false - default: 'false' type: bool url_rewrite: description: @@ -2456,14 +2441,12 @@ options: the actual request can include user credentials. - This translates to the Access-Control-Allow-Credentials header. required: false - default: 'false' type: bool disabled: description: - If true, specifies the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect. required: false - default: 'false' type: bool fault_injection_policy: description: diff --git a/plugins/modules/gcp_kms_crypto_key.py b/plugins/modules/gcp_kms_crypto_key.py index f10d7ba..4829081 100644 --- a/plugins/modules/gcp_kms_crypto_key.py +++ b/plugins/modules/gcp_kms_crypto_key.py @@ -104,6 +104,7 @@ options: - If set to true, the request will create a CryptoKey without any CryptoKeyVersions. You must use the `google_kms_key_ring_import_job` resource to import the CryptoKeyVersion. required: false + default: false type: bool project: description: diff --git a/plugins/modules/gcp_redis_instance.py b/plugins/modules/gcp_redis_instance.py index ac8724a..cef6eca 100644 --- a/plugins/modules/gcp_redis_instance.py +++ b/plugins/modules/gcp_redis_instance.py @@ -60,7 +60,6 @@ options: to "true" AUTH is enabled on the instance. - Default value is "false" meaning AUTH is disabled. required: false - default: 'false' type: bool authorized_network: description: diff --git a/plugins/modules/gcp_resourcemanager_project_info.py b/plugins/modules/gcp_resourcemanager_project_info.py index de30d65..1e747b7 100644 --- a/plugins/modules/gcp_resourcemanager_project_info.py +++ b/plugins/modules/gcp_resourcemanager_project_info.py @@ -86,7 +86,7 @@ options: description: - Indicates the number of projects that should be returned by the API request - type: str + type: int notes: - for authentication, you can set service_account_file using the C(GCP_SERVICE_ACCOUNT_FILE) env variable. diff --git a/plugins/modules/gcp_secret_manager.py b/plugins/modules/gcp_secret_manager.py index a02a402..a1e325e 100644 --- a/plugins/modules/gcp_secret_manager.py +++ b/plugins/modules/gcp_secret_manager.py @@ -25,7 +25,7 @@ description: - Add/remove versions of secrets. - Please note that other features like etags, replication, annontation expected to be managed outside of Ansible. short_description: Access and Update Google Cloud Secrets Manager objects -author: Dave Costakos @RedHat +author: Dave Costakos (@davecostakos) requirements: - python >= 2.6 - requests >= 2.18.4 @@ -44,6 +44,7 @@ options: - application - machineaccount - serviceaccount + - accesstoken service_account_contents: description: - The contents of a Service Account JSON file, either in a dictionary or as a @@ -58,11 +59,21 @@ options: - An optional service account email address if machineaccount is selected and the user does not wish to use the default email. type: str + access_token: + description: + - An OAuth2 access token if credential type is accesstoken. + type: str scopes: description: - Array of scopes to be used type: list elements: str + env_type: + description: + - Specifies which Ansible environment you're running this module within. + - This should not be set unless you know what you're doing. + - This only alters the User Agent string for any API requests. + type: str name: description: - Name of the secret to be used @@ -105,6 +116,7 @@ options: - only used in creation - Note that the "value" piece of a label must contain only readable chars type: dict + default: {} notes: - 'API Reference: U(https://cloud.google.com/secret-manager/docs/reference/rests)' - 'Official Documentation: U(https://cloud.google.com/secret-manager/docs/overview)' @@ -171,41 +183,42 @@ resources: description: List of resources returned: always type: complex - name: - description: - - The name of the secret - returned: success - type: str - version: - description: - - the version number of the secret returned - returned: success - type: str - url: - description: - - the Google Cloud URL used to make the request - returned: success - type: str - status_code: - description: - - the HTTP status code of the response to Google Cloud - returned: success - type: str - msg: - description: - - A message indicating what was done (or not done) - returned: success, failure - type: str - value: - description: - - The decrypted secret value, please use care with this - returned: success - type: str - payload: - description: - - The base 64 secret payload including CRC for validation - retunred: success - type: dict + contains: + name: + description: + - The name of the secret + returned: success + type: str + version: + description: + - the version number of the secret returned + returned: success + type: str + url: + description: + - the Google Cloud URL used to make the request + returned: success + type: str + status_code: + description: + - the HTTP status code of the response to Google Cloud + returned: success + type: str + msg: + description: + - A message indicating what was done (or not done) + returned: success, failure + type: str + value: + description: + - The decrypted secret value, please use care with this + returned: success + type: str + payload: + description: + - The base 64 secret payload including CRC for validation + returned: success + type: dict ''' ################################################################################ diff --git a/plugins/modules/gcp_sql_user_info.py b/plugins/modules/gcp_sql_user_info.py index 762a735..b03048d 100644 --- a/plugins/modules/gcp_sql_user_info.py +++ b/plugins/modules/gcp_sql_user_info.py @@ -158,7 +158,7 @@ import json def main(): - module = GcpModule(argument_spec=dict(instance=dict(required=True, type='dict'))) + module = GcpModule(argument_spec=dict(instance=dict(required=True, type='dict')), supports_check_mode=True) if not module.params['scopes']: module.params['scopes'] = ['https://www.googleapis.com/auth/sqlservice.admin'] diff --git a/plugins/modules/gcp_storage_default_object_acl.py b/plugins/modules/gcp_storage_default_object_acl.py index 5bfea2f..45c615f 100644 --- a/plugins/modules/gcp_storage_default_object_acl.py +++ b/plugins/modules/gcp_storage_default_object_acl.py @@ -62,6 +62,10 @@ options: - The name of the bucket. required: true type: dict + object: + description: + - The target of the ACL. + type: str entity: description: - 'The entity holding the permission, in one of the following forms: * user-{{userId}} diff --git a/plugins/modules/gcp_storage_object.py b/plugins/modules/gcp_storage_object.py index 1411d0f..aef0829 100644 --- a/plugins/modules/gcp_storage_object.py +++ b/plugins/modules/gcp_storage_object.py @@ -43,7 +43,6 @@ options: src: description: - Source location of file (may be local machine or cloud depending on action). Cloud locations need to be urlencoded including slashes. - required: true type: path dest: description: diff --git a/plugins/modules/gcp_tpu_node.py b/plugins/modules/gcp_tpu_node.py index 32d599e..87bcc47 100644 --- a/plugins/modules/gcp_tpu_node.py +++ b/plugins/modules/gcp_tpu_node.py @@ -94,7 +94,6 @@ options: to peer the TPU Node to is a Shared VPC network, the node must be created with this this field enabled. required: false - default: 'false' type: bool scheduling_config: description: