From 982933cfe87e863ef9678292d201d065ed4fb494 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 14 Dec 2018 13:00:18 -0800 Subject: [PATCH] Better resourceref flexibility (#149) /cc @rambleraptor --- plugins/module_utils/gcp_utils.py | 126 +++++++++++++----- plugins/modules/gcp_compute_address.py | 13 +- plugins/modules/gcp_compute_address_facts.py | 2 +- .../modules/gcp_compute_backend_service.py | 65 ++++----- .../gcp_compute_backend_service_facts.py | 2 +- plugins/modules/gcp_compute_disk.py | 26 ++-- plugins/modules/gcp_compute_disk_facts.py | 2 +- plugins/modules/gcp_compute_firewall.py | 11 +- plugins/modules/gcp_compute_firewall_facts.py | 2 +- .../modules/gcp_compute_forwarding_rule.py | 45 +++---- .../gcp_compute_forwarding_rule_facts.py | 8 +- .../gcp_compute_global_forwarding_rule.py | 35 ++--- ...cp_compute_global_forwarding_rule_facts.py | 6 +- plugins/modules/gcp_compute_image.py | 25 ++-- plugins/modules/gcp_compute_image_facts.py | 2 +- plugins/modules/gcp_compute_instance.py | 101 +++++++------- plugins/modules/gcp_compute_instance_facts.py | 8 +- plugins/modules/gcp_compute_instance_group.py | 29 ++-- .../gcp_compute_instance_group_facts.py | 4 +- .../gcp_compute_instance_group_manager.py | 21 +-- ...cp_compute_instance_group_manager_facts.py | 4 +- .../modules/gcp_compute_instance_template.py | 50 ++++--- .../gcp_compute_instance_template_facts.py | 8 +- .../gcp_compute_interconnect_attachment.py | 11 +- ...p_compute_interconnect_attachment_facts.py | 2 +- plugins/modules/gcp_compute_region_disk.py | 11 +- .../modules/gcp_compute_region_disk_facts.py | 2 +- plugins/modules/gcp_compute_route.py | 11 +- plugins/modules/gcp_compute_route_facts.py | 2 +- plugins/modules/gcp_compute_router.py | 31 +++-- plugins/modules/gcp_compute_router_facts.py | 2 +- plugins/modules/gcp_compute_subnetwork.py | 11 +- .../modules/gcp_compute_subnetwork_facts.py | 2 +- .../modules/gcp_compute_target_http_proxy.py | 11 +- .../gcp_compute_target_http_proxy_facts.py | 2 +- .../modules/gcp_compute_target_https_proxy.py | 24 ++-- .../gcp_compute_target_https_proxy_facts.py | 4 +- plugins/modules/gcp_compute_target_pool.py | 25 ++-- .../modules/gcp_compute_target_pool_facts.py | 4 +- .../modules/gcp_compute_target_ssl_proxy.py | 25 ++-- .../gcp_compute_target_ssl_proxy_facts.py | 4 +- .../modules/gcp_compute_target_tcp_proxy.py | 12 +- .../gcp_compute_target_tcp_proxy_facts.py | 2 +- .../modules/gcp_compute_target_vpn_gateway.py | 13 +- .../gcp_compute_target_vpn_gateway_facts.py | 2 +- plugins/modules/gcp_compute_url_map.py | 50 ++++--- plugins/modules/gcp_compute_url_map_facts.py | 8 +- plugins/modules/gcp_compute_vpn_tunnel.py | 23 ++-- .../modules/gcp_compute_vpn_tunnel_facts.py | 4 +- plugins/modules/gcp_container_node_pool.py | 31 +++-- .../modules/gcp_container_node_pool_facts.py | 11 +- .../modules/gcp_dns_resource_record_set.py | 11 +- .../gcp_dns_resource_record_set_facts.py | 11 +- .../modules/gcp_iam_service_account_key.py | 11 +- plugins/modules/gcp_pubsub_subscription.py | 22 ++- .../modules/gcp_pubsub_subscription_facts.py | 2 +- plugins/modules/gcp_spanner_database.py | 11 +- plugins/modules/gcp_spanner_database_facts.py | 11 +- plugins/modules/gcp_sql_database.py | 13 +- plugins/modules/gcp_sql_database_facts.py | 11 +- plugins/modules/gcp_sql_user.py | 13 +- plugins/modules/gcp_sql_user_facts.py | 11 +- plugins/modules/gcp_storage_bucket.py | 22 ++- .../gcp_storage_bucket_access_control.py | 11 +- 64 files changed, 569 insertions(+), 526 deletions(-) diff --git a/plugins/module_utils/gcp_utils.py b/plugins/module_utils/gcp_utils.py index d8162d1..881fd16 100644 --- a/plugins/module_utils/gcp_utils.py +++ b/plugins/module_utils/gcp_utils.py @@ -70,8 +70,7 @@ def replace_resource_dict(item, value): new_item = ast.literal_eval(item) return replace_resource_dict(new_item, value) except ValueError: - return item - + return new_item # Handles all authentication and HTTP sessions for GCP API calls. class GcpSession(object): @@ -225,12 +224,16 @@ class GcpModule(AnsibleModule): return new -# This class takes in two dictionaries `a` and `b`. -# These are dictionaries of arbitrary depth, but made up of standard Python -# types only. -# This differ will compare all values in `a` to those in `b`. -# Note: Only keys in `a` will be compared. Extra keys in `b` will be ignored. -# Note: On all lists, order does matter. +# This class does difference checking according to a set of GCP-specific rules. +# This will be primarily used for checking dictionaries. +# In an equivalence check, the left-hand dictionary will be the request and +# the right-hand side will be the response. + +# Rules: +# Extra keys in response will be ignored. +# Ordering of lists does not matter. +# - exception: lists of dictionaries are +# assumed to be in sorted order. class GcpRequest(object): def __init__(self, request): self.request = request @@ -241,31 +244,48 @@ class GcpRequest(object): def __ne__(self, other): return not self.__eq__(other) - # Returns the difference between `self.request` and `b` - def difference(self, b): - return self._compare_dicts(self.request, b.request) + # Returns the difference between a request + response. + # While this is used under the hood for __eq__ and __ne__, + # it is useful for debugging. + def difference(self, response): + return self._compare_value(self.request, response.request) - def _compare_dicts(self, dict1, dict2): + def _compare_dicts(self, req_dict, resp_dict): difference = {} - for key in dict1: - difference[key] = self._compare_value(dict1.get(key), dict2.get(key)) + for key in req_dict: + if resp_dict.get(key): + difference[key] = self._compare_value(req_dict.get(key), resp_dict.get(key)) # Remove all empty values from difference. - difference2 = {} + sanitized_difference = {} for key in difference: if difference[key]: - difference2[key] = difference[key] + sanitized_difference[key] = difference[key] - return difference2 + return sanitized_difference # Takes in two lists and compares them. - def _compare_lists(self, list1, list2): + # All things in the list should be identical (even if a dictionary) + def _compare_lists(self, req_list, resp_list): + # Have to convert each thing over to unicode. + # Python doesn't handle equality checks between unicode + non-unicode well. difference = [] - for index in range(len(list1)): - value1 = list1[index] - if index < len(list2): - value2 = list2[index] - difference.append(self._compare_value(value1, value2)) + new_req_list = self._convert_value(req_list) + new_resp_list = self._convert_value(resp_list) + + # We have to compare each thing in the request to every other thing + # in the response. + # This is because the request value will be a subset of the response value. + # The assumption is that these lists will be small enough that it won't + # be a performance burden. + for req_item in new_req_list: + found_item = False + for resp_item in new_resp_list: + # Looking for a None value here. + if not self._compare_value(req_item, resp_item): + found_item = True + if not found_item: + difference.append(req_item) difference2 = [] for value in difference: @@ -274,25 +294,69 @@ class GcpRequest(object): return difference2 - def _compare_value(self, value1, value2): + # Compare two values of arbitrary types. + def _compare_value(self, req_value, resp_value): diff = None # If a None is found, a difference does not exist. # Only differing values matter. - if not value2: + if not resp_value: return None # Can assume non-None types at this point. try: - if isinstance(value1, list): - diff = self._compare_lists(value1, value2) - elif isinstance(value2, dict): - diff = self._compare_dicts(value1, value2) + if isinstance(req_value, list): + diff = self._compare_lists(req_value, resp_value) + elif isinstance(req_value, dict): + diff = self._compare_dicts(req_value, resp_value) + elif isinstance(req_value, bool): + diff = self._compare_boolean(req_value, resp_value) # Always use to_text values to avoid unicode issues. - elif to_text(value1) != to_text(value2): - diff = value1 + elif to_text(req_value) != to_text(resp_value): + diff = req_value # to_text may throw UnicodeErrors. # These errors shouldn't crash Ansible and should be hidden. except UnicodeError: pass return diff + + # Compare two boolean values. + def _compare_boolean(self, req_value, resp_value): + try: + # Both True + if req_value and isinstance(resp_value, bool) and resp_value: + return None + # Value1 True, resp_value 'true' + elif req_value and to_text(resp_value) == 'true': + return None + # Both False + elif not req_value and isinstance(resp_value, bool) and not resp_value: + return None + # Value1 False, resp_value 'false' + elif not req_value and to_text(resp_value) == 'false': + return None + else: + return resp_value + + # to_text may throw UnicodeErrors. + # These errors shouldn't crash Ansible and should be hidden. + except UnicodeError: + return None + + # Python (2 esp.) doesn't do comparisons between unicode + non-unicode well. + # This leads to a lot of false positives when diffing values. + # The Ansible to_text() function is meant to get all strings + # into a standard format. + def _convert_value(self, value): + if isinstance(value, list): + new_list = [] + for item in value: + new_list.append(self._convert_value(item)) + return new_list + elif isinstance(value, dict): + new_dict = {} + for key in value: + new_dict[key] = self._convert_value(value[key]) + return new_dict + else: + return to_text(value) diff --git a/plugins/modules/gcp_compute_address.py b/plugins/modules/gcp_compute_address.py index 73f6e31..7c614c0 100644 --- a/plugins/modules/gcp_compute_address.py +++ b/plugins/modules/gcp_compute_address.py @@ -101,10 +101,9 @@ options: - This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes. - 'This field represents a link to a Subnetwork resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_subnetwork - task and then set this subnetwork field to "{{ name-of-resource }}" Alternatively, - you can set this subnetwork to a dictionary with the selfLink key where the - value is the selfLink of your Subnetwork' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_subnetwork + task and then set this subnetwork field to "{{ name-of-resource }}"' required: false version_added: 2.7 region: @@ -182,7 +181,7 @@ subnetwork: - This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes. returned: success - type: dict + type: str users: description: - The URLs of the resources that are using this address. @@ -220,8 +219,8 @@ def main(): description=dict(type='str'), name=dict(required=True, type='str'), network_tier=dict(type='str', choices=['PREMIUM', 'STANDARD']), - subnetwork=dict(type='dict'), - region=dict(required=True, type='str'), + subnetwork=dict(), + region=dict(required=True, type='str') ) ) diff --git a/plugins/modules/gcp_compute_address_facts.py b/plugins/modules/gcp_compute_address_facts.py index 43db493..9a22442 100644 --- a/plugins/modules/gcp_compute_address_facts.py +++ b/plugins/modules/gcp_compute_address_facts.py @@ -121,7 +121,7 @@ items: - This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes. returned: success - type: dict + type: str users: description: - The URLs of the resources that are using this address. diff --git a/plugins/modules/gcp_compute_backend_service.py b/plugins/modules/gcp_compute_backend_service.py index a6f75da..3775e2c 100644 --- a/plugins/modules/gcp_compute_backend_service.py +++ b/plugins/modules/gcp_compute_backend_service.py @@ -96,10 +96,10 @@ options: - When the BackendService has load balancing scheme INTERNAL, the instance group must be in a zone within the same region as the BackendService. - 'This field represents a link to a InstanceGroup resource in GCP. It can - be specified in two ways. You can add `register: name-of-resource` to a - gcp_compute_instance_group task and then set this group field to "{{ name-of-resource - }}" Alternatively, you can set this group to a dictionary with the selfLink - key where the value is the selfLink of your InstanceGroup' + be specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` + to a gcp_compute_instance_group task and then set this group field to "{{ + name-of-resource }}"' required: false max_connections: description: @@ -389,7 +389,7 @@ backends: - When the BackendService has load balancing scheme INTERNAL, the instance group must be in a zone within the same region as the BackendService. returned: success - type: dict + type: str maxConnections: description: - The max number of simultaneous connections for the group. Can be used with @@ -623,38 +623,29 @@ def main(): argument_spec=dict( state=dict(default='present', choices=['present', 'absent'], type='str'), affinity_cookie_ttl_sec=dict(type='int'), - backends=dict( - type='list', - elements='dict', - options=dict( - balancing_mode=dict(default='UTILIZATION', type='str', choices=['UTILIZATION', 'RATE', 'CONNECTION']), - capacity_scaler=dict(default=1.0, type='str'), - description=dict(type='str'), - group=dict(type='str'), - max_connections=dict(type='int'), - max_connections_per_instance=dict(type='int'), - max_rate=dict(type='int'), - max_rate_per_instance=dict(type='str'), - max_utilization=dict(default=0.8, type='str'), - ), - ), - cdn_policy=dict( - type='dict', - options=dict( - cache_key_policy=dict( - type='dict', - options=dict( - include_host=dict(type='bool'), - include_protocol=dict(type='bool'), - include_query_string=dict(type='bool'), - query_string_blacklist=dict(type='list', elements='str'), - query_string_whitelist=dict(type='list', elements='str'), - ), - ), - signed_url_cache_max_age_sec=dict(default=3600, type='int'), - ), - ), - connection_draining=dict(type='dict', options=dict(draining_timeout_sec=dict(default=300, type='int'))), + backends=dict(type='list', elements='dict', options=dict( + balancing_mode=dict(type='str', choices=['UTILIZATION', 'RATE', 'CONNECTION']), + capacity_scaler=dict(type='str'), + description=dict(type='str'), + group=dict(), + max_connections=dict(type='int'), + max_connections_per_instance=dict(type='int'), + max_rate=dict(type='int'), + max_rate_per_instance=dict(type='str'), + max_utilization=dict(type='str') + )), + cdn_policy=dict(type='dict', options=dict( + cache_key_policy=dict(type='dict', options=dict( + include_host=dict(type='bool'), + include_protocol=dict(type='bool'), + include_query_string=dict(type='bool'), + query_string_blacklist=dict(type='list', elements='str'), + query_string_whitelist=dict(type='list', elements='str') + )) + )), + connection_draining=dict(type='dict', options=dict( + draining_timeout_sec=dict(type='int') + )), description=dict(type='str'), enable_cdn=dict(type='bool'), health_checks=dict(required=True, type='list', elements='str'), diff --git a/plugins/modules/gcp_compute_backend_service_facts.py b/plugins/modules/gcp_compute_backend_service_facts.py index e8f0481..2db16e1 100644 --- a/plugins/modules/gcp_compute_backend_service_facts.py +++ b/plugins/modules/gcp_compute_backend_service_facts.py @@ -114,7 +114,7 @@ items: - When the BackendService has load balancing scheme INTERNAL, the instance group must be in a zone within the same region as the BackendService. returned: success - type: dict + type: str maxConnections: description: - The max number of simultaneous connections for the group. Can be used diff --git a/plugins/modules/gcp_compute_disk.py b/plugins/modules/gcp_compute_disk.py index 46fc55f..7cc3661 100644 --- a/plugins/modules/gcp_compute_disk.py +++ b/plugins/modules/gcp_compute_disk.py @@ -156,10 +156,9 @@ options: - The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. - 'This field represents a link to a Snapshot resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_snapshot - task and then set this source_snapshot field to "{{ name-of-resource }}" Alternatively, - you can set this source_snapshot to a dictionary with the selfLink key where - the value is the selfLink of your Snapshot' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_snapshot + task and then set this source_snapshot field to "{{ name-of-resource }}"' required: false source_snapshot_encryption_key: description: @@ -350,7 +349,7 @@ sourceSnapshot: - The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. returned: success - type: dict + type: str sourceSnapshotEncryptionKey: description: - The customer-supplied encryption key of the source snapshot. Required if the source @@ -410,10 +409,19 @@ def main(): type=dict(type='str'), source_image=dict(type='str'), zone=dict(required=True, type='str'), - source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), - disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), - source_snapshot=dict(type='dict'), - source_snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), kms_key_name=dict(type='str'))), + source_image_encryption_key=dict(type='dict', options=dict( + raw_key=dict(type='str'), + sha256=dict(type='str') + )), + disk_encryption_key=dict(type='dict', options=dict( + raw_key=dict(type='str'), + sha256=dict(type='str') + )), + source_snapshot=dict(), + source_snapshot_encryption_key=dict(type='dict', options=dict( + raw_key=dict(type='str'), + sha256=dict(type='str') + )) ) ) diff --git a/plugins/modules/gcp_compute_disk_facts.py b/plugins/modules/gcp_compute_disk_facts.py index eedfa4f..aa8a124 100644 --- a/plugins/modules/gcp_compute_disk_facts.py +++ b/plugins/modules/gcp_compute_disk_facts.py @@ -223,7 +223,7 @@ items: - The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. returned: success - type: dict + type: str sourceSnapshotEncryptionKey: description: - The customer-supplied encryption key of the source snapshot. Required if the diff --git a/plugins/modules/gcp_compute_firewall.py b/plugins/modules/gcp_compute_firewall.py index 02bafb1..8120566 100644 --- a/plugins/modules/gcp_compute_firewall.py +++ b/plugins/modules/gcp_compute_firewall.py @@ -146,10 +146,9 @@ options: networks/my-network projects/myproject/global/networks/my-network global/networks/default .' - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: false default: selfLink: global/networks/default @@ -342,7 +341,7 @@ network: networks/my-network projects/myproject/global/networks/my-network global/networks/default .' returned: success - type: dict + type: str priority: description: - Priority for this rule. This is an integer between 0 and 65535, both inclusive. @@ -440,7 +439,7 @@ def main(): direction=dict(type='str', choices=['INGRESS', 'EGRESS']), disabled=dict(type='bool'), name=dict(required=True, type='str'), - network=dict(default={'selfLink': 'global/networks/default'}, type='dict'), + network=dict(default={'selfLink': 'global/networks/default'}), priority=dict(default=1000, type='int'), source_ranges=dict(type='list', elements='str'), source_service_accounts=dict(type='list', elements='str'), diff --git a/plugins/modules/gcp_compute_firewall_facts.py b/plugins/modules/gcp_compute_firewall_facts.py index 03da384..044d272 100644 --- a/plugins/modules/gcp_compute_firewall_facts.py +++ b/plugins/modules/gcp_compute_firewall_facts.py @@ -169,7 +169,7 @@ items: networks/my-network projects/myproject/global/networks/my-network global/networks/default .' returned: success - type: dict + type: str priority: description: - Priority for this rule. This is an integer between 0 and 65535, both inclusive. diff --git a/plugins/modules/gcp_compute_forwarding_rule.py b/plugins/modules/gcp_compute_forwarding_rule.py index 069acd0..478d026 100644 --- a/plugins/modules/gcp_compute_forwarding_rule.py +++ b/plugins/modules/gcp_compute_forwarding_rule.py @@ -95,10 +95,10 @@ options: - This is used for internal load balancing. - "(not used for external load balancing) ." - 'This field represents a link to a BackendService resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_compute_backend_service - task and then set this backend_service field to "{{ name-of-resource }}" Alternatively, - you can set this backend_service to a dictionary with the selfLink key where - the value is the selfLink of your BackendService' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_backend_service task and then set this backend_service field to + "{{ name-of-resource }}"' required: false ip_version: description: @@ -135,10 +135,9 @@ options: specified, the default network will be used. - This field is not used for external load balancing. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: false port_range: description: @@ -171,10 +170,9 @@ options: if the network is in custom subnet mode, a subnetwork must be specified. - This field is not used for external load balancing. - 'This field represents a link to a Subnetwork resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_subnetwork - task and then set this subnetwork field to "{{ name-of-resource }}" Alternatively, - you can set this subnetwork to a dictionary with the selfLink key where the - value is the selfLink of your Subnetwork' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_subnetwork + task and then set this subnetwork field to "{{ name-of-resource }}"' required: false target: description: @@ -185,10 +183,9 @@ options: target object. - This field is not used for internal load balancing. - 'This field represents a link to a TargetPool resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_target_pool - task and then set this target field to "{{ name-of-resource }}" Alternatively, - you can set this target to a dictionary with the selfLink key where the value - is the selfLink of your TargetPool' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_target_pool + task and then set this target field to "{{ name-of-resource }}"' required: false version_added: 2.7 network_tier: @@ -300,7 +297,7 @@ backendService: - This is used for internal load balancing. - "(not used for external load balancing) ." returned: success - type: dict + type: str ipVersion: description: - The IP Version that will be used by this forwarding rule. Valid options are IPV4 @@ -333,7 +330,7 @@ network: the default network will be used. - This field is not used for external load balancing. returned: success - type: dict + type: str portRange: description: - This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, @@ -366,7 +363,7 @@ subnetwork: if the network is in custom subnet mode, a subnetwork must be specified. - This field is not used for external load balancing. returned: success - type: dict + type: str target: description: - A reference to a TargetPool resource to receive the matched traffic. @@ -376,7 +373,7 @@ target: target object. - This field is not used for internal load balancing. returned: success - type: dict + type: str networkTier: description: - 'The networking tier used for configuring this address. This field can take the @@ -414,15 +411,15 @@ def main(): description=dict(type='str'), ip_address=dict(type='str'), ip_protocol=dict(type='str', choices=['TCP', 'UDP', 'ESP', 'AH', 'SCTP', 'ICMP']), - backend_service=dict(type='dict'), + backend_service=dict(), ip_version=dict(type='str', choices=['IPV4', 'IPV6']), load_balancing_scheme=dict(type='str', choices=['INTERNAL', 'EXTERNAL']), name=dict(required=True, type='str'), - network=dict(type='dict'), + network=dict(), port_range=dict(type='str'), ports=dict(type='list', elements='str'), - subnetwork=dict(type='dict'), - target=dict(type='dict'), + subnetwork=dict(), + target=dict(), network_tier=dict(type='str', choices=['PREMIUM', 'STANDARD']), region=dict(required=True, type='str') ) diff --git a/plugins/modules/gcp_compute_forwarding_rule_facts.py b/plugins/modules/gcp_compute_forwarding_rule_facts.py index eea62fc..725a317 100644 --- a/plugins/modules/gcp_compute_forwarding_rule_facts.py +++ b/plugins/modules/gcp_compute_forwarding_rule_facts.py @@ -122,7 +122,7 @@ items: - This is used for internal load balancing. - "(not used for external load balancing) ." returned: success - type: dict + type: str ipVersion: description: - The IP Version that will be used by this forwarding rule. Valid options are @@ -155,7 +155,7 @@ items: specified, the default network will be used. - This field is not used for external load balancing. returned: success - type: dict + type: str portRange: description: - This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, @@ -190,7 +190,7 @@ items: if the network is in custom subnet mode, a subnetwork must be specified. - This field is not used for external load balancing. returned: success - type: dict + type: str target: description: - A reference to a TargetPool resource to receive the matched traffic. @@ -200,7 +200,7 @@ items: to the target object. - This field is not used for internal load balancing. returned: success - type: dict + type: str networkTier: description: - 'The networking tier used for configuring this address. This field can take diff --git a/plugins/modules/gcp_compute_global_forwarding_rule.py b/plugins/modules/gcp_compute_global_forwarding_rule.py index ff08edf..4dc44f0 100644 --- a/plugins/modules/gcp_compute_global_forwarding_rule.py +++ b/plugins/modules/gcp_compute_global_forwarding_rule.py @@ -97,10 +97,10 @@ options: - This is used for internal load balancing. - "(not used for external load balancing) ." - 'This field represents a link to a BackendService resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_compute_backend_service - task and then set this backend_service field to "{{ name-of-resource }}" Alternatively, - you can set this backend_service to a dictionary with the selfLink key where - the value is the selfLink of your BackendService' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_backend_service task and then set this backend_service field to + "{{ name-of-resource }}"' required: false ip_version: description: @@ -137,10 +137,9 @@ options: specified, the default network will be used. - This field is not used for external load balancing. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: false port_range: description: @@ -173,10 +172,9 @@ options: if the network is in custom subnet mode, a subnetwork must be specified. - This field is not used for external load balancing. - 'This field represents a link to a Subnetwork resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_subnetwork - task and then set this subnetwork field to "{{ name-of-resource }}" Alternatively, - you can set this subnetwork to a dictionary with the selfLink key where the - value is the selfLink of your Subnetwork' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_subnetwork + task and then set this subnetwork field to "{{ name-of-resource }}"' required: false target: description: @@ -320,7 +318,7 @@ backendService: - This is used for internal load balancing. - "(not used for external load balancing) ." returned: success - type: dict + type: str ipVersion: description: - The IP Version that will be used by this forwarding rule. Valid options are IPV4 @@ -353,7 +351,7 @@ network: the default network will be used. - This field is not used for external load balancing. returned: success - type: dict + type: str portRange: description: - This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, @@ -386,7 +384,7 @@ subnetwork: if the network is in custom subnet mode, a subnetwork must be specified. - This field is not used for external load balancing. returned: success - type: dict + type: str region: description: - A reference to the region where the regional forwarding rule resides. @@ -424,12 +422,15 @@ def main(): description=dict(type='str'), ip_address=dict(type='str'), ip_protocol=dict(type='str', choices=['TCP', 'UDP', 'ESP', 'AH', 'SCTP', 'ICMP']), + backend_service=dict(), ip_version=dict(type='str', choices=['IPV4', 'IPV6']), load_balancing_scheme=dict(type='str', choices=['INTERNAL_SELF_MANAGED', 'EXTERNAL']), name=dict(required=True, type='str'), - network=dict(type='dict'), + network=dict(), port_range=dict(type='str'), - target=dict(required=True, type='str'), + ports=dict(type='list', elements='str'), + subnetwork=dict(), + target=dict(type='str') ) ) diff --git a/plugins/modules/gcp_compute_global_forwarding_rule_facts.py b/plugins/modules/gcp_compute_global_forwarding_rule_facts.py index 4a8f94c..d07cbe1 100644 --- a/plugins/modules/gcp_compute_global_forwarding_rule_facts.py +++ b/plugins/modules/gcp_compute_global_forwarding_rule_facts.py @@ -116,7 +116,7 @@ items: - This is used for internal load balancing. - "(not used for external load balancing) ." returned: success - type: dict + type: str ipVersion: description: - The IP Version that will be used by this forwarding rule. Valid options are @@ -149,7 +149,7 @@ items: specified, the default network will be used. - This field is not used for external load balancing. returned: success - type: dict + type: str portRange: description: - This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, @@ -184,7 +184,7 @@ items: if the network is in custom subnet mode, a subnetwork must be specified. - This field is not used for external load balancing. returned: success - type: dict + type: str region: description: - A reference to the region where the regional forwarding rule resides. diff --git a/plugins/modules/gcp_compute_image.py b/plugins/modules/gcp_compute_image.py index 5dd4af4..b5ec226 100644 --- a/plugins/modules/gcp_compute_image.py +++ b/plugins/modules/gcp_compute_image.py @@ -152,10 +152,9 @@ options: - Refers to a gcompute_disk object You must provide either this property or the rawDisk.source property but not both to create an image. - 'This field represents a link to a Disk resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_disk - task and then set this source_disk field to "{{ name-of-resource }}" Alternatively, - you can set this source_disk to a dictionary with the selfLink key where the - value is the selfLink of your Disk' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_disk + task and then set this source_disk field to "{{ name-of-resource }}"' required: false source_disk_encryption_key: description: @@ -377,7 +376,7 @@ sourceDisk: - Refers to a gcompute_disk object You must provide either this property or the rawDisk.source property but not both to create an image. returned: success - type: dict + type: str sourceDiskEncryptionKey: description: - The customer-supplied encryption key of the source disk. Required if the source @@ -440,12 +439,16 @@ def main(): labels=dict(type='dict'), licenses=dict(type='list', elements='str'), name=dict(required=True, type='str'), - raw_disk=dict( - type='dict', - options=dict(container_type=dict(type='str', choices=['TAR']), sha1_checksum=dict(type='str'), source=dict(required=True, type='str')), - ), - source_disk=dict(type='dict'), - source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))), + raw_disk=dict(type='dict', options=dict( + container_type=dict(type='str', choices=['TAR']), + sha1_checksum=dict(type='str'), + source=dict(type='str') + )), + source_disk=dict(), + source_disk_encryption_key=dict(type='dict', options=dict( + raw_key=dict(type='str'), + sha256=dict(type='str') + )), source_disk_id=dict(type='str'), source_type=dict(type='str', choices=['RAW']), ) diff --git a/plugins/modules/gcp_compute_image_facts.py b/plugins/modules/gcp_compute_image_facts.py index 8a3a8fd..6109fa9 100644 --- a/plugins/modules/gcp_compute_image_facts.py +++ b/plugins/modules/gcp_compute_image_facts.py @@ -231,7 +231,7 @@ items: - Refers to a gcompute_disk object You must provide either this property or the rawDisk.source property but not both to create an image. returned: success - type: dict + type: str sourceDiskEncryptionKey: description: - The customer-supplied encryption key of the source disk. Required if the source diff --git a/plugins/modules/gcp_compute_instance.py b/plugins/modules/gcp_compute_instance.py index 1d2bcb3..d4f00b9 100644 --- a/plugins/modules/gcp_compute_instance.py +++ b/plugins/modules/gcp_compute_instance.py @@ -181,10 +181,9 @@ options: - If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. - 'This field represents a link to a Disk resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_disk - task and then set this source field to "{{ name-of-resource }}" Alternatively, - you can set this source to a dictionary with the selfLink key where the - value is the selfLink of your Disk' + in two ways. First, you can place in the selfLink of the resource here as + a string Alternatively, you can add `register: name-of-resource` to a gcp_compute_disk + task and then set this source field to "{{ name-of-resource }}"' required: false type: description: @@ -267,10 +266,10 @@ options: address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. - 'This field represents a link to a Address resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a - gcp_compute_address task and then set this nat_ip field to "{{ name-of-resource - }}" Alternatively, you can set this nat_ip to a dictionary with the - address key where the value is the address of your Address' + specified in two ways. First, you can place in the address of the resource + here as a string Alternatively, you can add `register: name-of-resource` + to a gcp_compute_address task and then set this nat_ip field to "{{ + name-of-resource }}"' required: false type: description: @@ -310,10 +309,9 @@ options: global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the - value is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as + a string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: false network_ip: description: @@ -328,10 +326,10 @@ options: If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. - 'This field represents a link to a Subnetwork resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_compute_subnetwork - task and then set this subnetwork field to "{{ name-of-resource }}" Alternatively, - you can set this subnetwork to a dictionary with the selfLink key where - the value is the selfLink of your Subnetwork' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` + to a gcp_compute_subnetwork task and then set this subnetwork field to "{{ + name-of-resource }}"' required: false scheduling: description: @@ -629,7 +627,7 @@ disks: - If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. returned: success - type: dict + type: str type: description: - Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, @@ -725,7 +723,7 @@ networkInterfaces: address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. returned: success - type: dict + type: str type: description: - The type of configuration. The default and only option is ONE_TO_ONE_NAT. @@ -767,7 +765,7 @@ networkInterfaces: global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. returned: success - type: dict + type: str networkIP: description: - An IPv4 internal network address to assign to the instance for this network @@ -782,7 +780,7 @@ networkInterfaces: the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. returned: success - type: dict + type: str scheduling: description: - Sets the scheduling options for this instance. @@ -891,33 +889,36 @@ def main(): module = GcpModule( argument_spec=dict( state=dict(default='present', choices=['present', 'absent'], type='str'), - can_ip_forward=dict(type='bool', aliases=['ip_forward']), - disks=dict( - type='list', - elements='dict', - options=dict( - auto_delete=dict(type='bool'), - boot=dict(type='bool'), - device_name=dict(type='str'), - disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'))), - index=dict(type='int'), - initialize_params=dict( - type='dict', - options=dict( - disk_name=dict(type='str'), - disk_size_gb=dict(type='int'), - disk_type=dict(type='str'), - source_image=dict(type='str', aliases=['image', 'image_family']), - source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))), - ), - ), - interface=dict(type='str', choices=['SCSI', 'NVME']), - mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']), - source=dict(type='dict'), - type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']), - ), - ), - guest_accelerators=dict(type='list', elements='dict', options=dict(accelerator_count=dict(type='int'), accelerator_type=dict(type='str'))), + can_ip_forward=dict(type='bool'), + disks=dict(type='list', elements='dict', options=dict( + auto_delete=dict(type='bool'), + boot=dict(type='bool'), + device_name=dict(type='str'), + disk_encryption_key=dict(type='dict', options=dict( + raw_key=dict(type='str'), + rsa_encrypted_key=dict(type='str'), + sha256=dict(type='str') + )), + index=dict(type='int'), + initialize_params=dict(type='dict', options=dict( + disk_name=dict(type='str'), + disk_size_gb=dict(type='int'), + disk_type=dict(type='str'), + source_image=dict(type='str'), + source_image_encryption_key=dict(type='dict', options=dict( + raw_key=dict(type='str'), + sha256=dict(type='str') + )) + )), + interface=dict(type='str', choices=['SCSI', 'NVME']), + mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']), + source=dict(), + type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']) + )), + guest_accelerators=dict(type='list', elements='dict', options=dict( + accelerator_count=dict(type='int'), + accelerator_type=dict(type='str') + )), label_fingerprint=dict(type='str'), metadata=dict(type='dict'), machine_type=dict(type='str'), @@ -926,7 +927,7 @@ def main(): network_interfaces=dict(type='list', elements='dict', options=dict( access_configs=dict(type='list', elements='dict', options=dict( name=dict(required=True, type='str'), - nat_ip=dict(type='dict'), + nat_ip=dict(), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT']) )), alias_ip_ranges=dict(type='list', elements='dict', options=dict( @@ -934,9 +935,9 @@ def main(): subnetwork_range_name=dict(type='str') )), name=dict(type='str'), - network=dict(type='dict'), + network=dict(), network_ip=dict(type='str'), - subnetwork=dict(type='dict') + subnetwork=dict() )), scheduling=dict(type='dict', options=dict( automatic_restart=dict(type='bool'), diff --git a/plugins/modules/gcp_compute_instance_facts.py b/plugins/modules/gcp_compute_instance_facts.py index 7ebd9b4..8bc9e5c 100644 --- a/plugins/modules/gcp_compute_instance_facts.py +++ b/plugins/modules/gcp_compute_instance_facts.py @@ -225,7 +225,7 @@ items: - If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. returned: success - type: dict + type: str type: description: - Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, @@ -323,7 +323,7 @@ items: IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. returned: success - type: dict + type: str type: description: - The type of configuration. The default and only option is ONE_TO_ONE_NAT. @@ -365,7 +365,7 @@ items: default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. returned: success - type: dict + type: str networkIP: description: - An IPv4 internal network address to assign to the instance for this network @@ -380,7 +380,7 @@ items: If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. returned: success - type: dict + type: str scheduling: description: - Sets the scheduling options for this instance. diff --git a/plugins/modules/gcp_compute_instance_group.py b/plugins/modules/gcp_compute_instance_group.py index e31aef2..16a2129 100644 --- a/plugins/modules/gcp_compute_instance_group.py +++ b/plugins/modules/gcp_compute_instance_group.py @@ -83,10 +83,9 @@ options: description: - The network to which all instances in the instance group belong. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: false region: description: @@ -96,10 +95,9 @@ options: description: - The subnetwork to which all instances in the instance group belong. - 'This field represents a link to a Subnetwork resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_subnetwork - task and then set this subnetwork field to "{{ name-of-resource }}" Alternatively, - you can set this subnetwork to a dictionary with the selfLink key where the - value is the selfLink of your Subnetwork' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_subnetwork + task and then set this subnetwork field to "{{ name-of-resource }}"' required: false zone: description: @@ -190,7 +188,7 @@ network: description: - The network to which all instances in the instance group belong. returned: success - type: dict + type: str region: description: - The region where the instance group is located (for regional resources). @@ -200,7 +198,7 @@ subnetwork: description: - The subnetwork to which all instances in the instance group belong. returned: success - type: dict + type: str zone: description: - A reference to the zone where the instance group resides. @@ -239,12 +237,15 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), description=dict(type='str'), name=dict(type='str'), - named_ports=dict(type='list', elements='dict', options=dict(name=dict(type='str'), port=dict(type='int'))), - network=dict(type='dict'), + named_ports=dict(type='list', elements='dict', options=dict( + name=dict(type='str'), + port=dict(type='int') + )), + network=dict(), region=dict(type='str'), - subnetwork=dict(type='dict'), + subnetwork=dict(), zone=dict(required=True, type='str'), - instances=dict(type='list', elements='dict') + instances=dict(type='list') ) ) diff --git a/plugins/modules/gcp_compute_instance_group_facts.py b/plugins/modules/gcp_compute_instance_group_facts.py index 1e89450..4463146 100644 --- a/plugins/modules/gcp_compute_instance_group_facts.py +++ b/plugins/modules/gcp_compute_instance_group_facts.py @@ -117,7 +117,7 @@ items: description: - The network to which all instances in the instance group belong. returned: success - type: dict + type: str region: description: - The region where the instance group is located (for regional resources). @@ -127,7 +127,7 @@ items: description: - The subnetwork to which all instances in the instance group belong. returned: success - type: dict + type: str zone: description: - A reference to the zone where the instance group resides. diff --git a/plugins/modules/gcp_compute_instance_group_manager.py b/plugins/modules/gcp_compute_instance_group_manager.py index 04fecfa..64d7728 100644 --- a/plugins/modules/gcp_compute_instance_group_manager.py +++ b/plugins/modules/gcp_compute_instance_group_manager.py @@ -70,10 +70,10 @@ options: group uses this template to create all new instances in the managed instance group. - 'This field represents a link to a InstanceTemplate resource in GCP. It can - be specified in two ways. You can add `register: name-of-resource` to a gcp_compute_instance_template - task and then set this instance_template field to "{{ name-of-resource }}" Alternatively, - you can set this instance_template to a dictionary with the selfLink key where - the value is the selfLink of your InstanceTemplate' + be specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_instance_template task and then set this instance_template field + to "{{ name-of-resource }}"' required: true name: description: @@ -261,13 +261,13 @@ instanceGroup: description: - The instance group being managed. returned: success - type: dict + type: str instanceTemplate: description: - The instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. returned: success - type: dict + type: str name: description: - The name of the managed instance group. The name must be 1-63 characters long, @@ -339,10 +339,13 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), base_instance_name=dict(required=True, type='str'), description=dict(type='str'), - instance_template=dict(required=True, type='dict'), + instance_template=dict(required=True), name=dict(required=True, type='str'), - named_ports=dict(type='list', elements='dict', options=dict(name=dict(type='str'), port=dict(type='int'))), - target_pools=dict(type='list', elements='dict'), + named_ports=dict(type='list', elements='dict', options=dict( + name=dict(type='str'), + port=dict(type='int') + )), + target_pools=dict(type='list'), target_size=dict(type='int'), zone=dict(required=True, type='str'), ) diff --git a/plugins/modules/gcp_compute_instance_group_manager_facts.py b/plugins/modules/gcp_compute_instance_group_manager_facts.py index 9e9584b..32c560d 100644 --- a/plugins/modules/gcp_compute_instance_group_manager_facts.py +++ b/plugins/modules/gcp_compute_instance_group_manager_facts.py @@ -161,14 +161,14 @@ items: description: - The instance group being managed. returned: success - type: dict + type: str instanceTemplate: description: - The instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. returned: success - type: dict + type: str name: description: - The name of the managed instance group. The name must be 1-63 characters long, diff --git a/plugins/modules/gcp_compute_instance_template.py b/plugins/modules/gcp_compute_instance_template.py index 9bdf427..74ed16e 100644 --- a/plugins/modules/gcp_compute_instance_template.py +++ b/plugins/modules/gcp_compute_instance_template.py @@ -211,10 +211,10 @@ options: - Note that for InstanceTemplate, specify the disk name, not the URL for the disk. - 'This field represents a link to a Disk resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_disk - task and then set this source field to "{{ name-of-resource }}" Alternatively, - you can set this source to a dictionary with the name key where the - value is the name of your Disk' + in two ways. First, you can place in the name of the resource here as + a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_disk task and then set this source field to "{{ name-of-resource + }}"' required: false type: description: @@ -283,11 +283,10 @@ options: IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. - 'This field represents a link to a Address resource in GCP. It can - be specified in two ways. You can add `register: name-of-resource` - to a gcp_compute_address task and then set this nat_ip field to - "{{ name-of-resource }}" Alternatively, you can set this nat_ip - to a dictionary with the address key where the value is the address - of your Address' + be specified in two ways. First, you can place in the address of + the resource here as a string Alternatively, you can add `register: + name-of-resource` to a gcp_compute_address task and then set this + nat_ip field to "{{ name-of-resource }}"' required: false type: description: @@ -328,10 +327,10 @@ options: default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. - 'This field represents a link to a Network resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a - gcp_compute_network task and then set this network field to "{{ name-of-resource - }}" Alternatively, you can set this network to a dictionary with the - selfLink key where the value is the selfLink of your Network' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` + to a gcp_compute_network task and then set this network field to "{{ + name-of-resource }}"' required: false network_ip: description: @@ -346,11 +345,10 @@ options: If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. - 'This field represents a link to a Subnetwork resource in GCP. It can - be specified in two ways. You can add `register: name-of-resource` to - a gcp_compute_subnetwork task and then set this subnetwork field to - "{{ name-of-resource }}" Alternatively, you can set this subnetwork - to a dictionary with the selfLink key where the value is the selfLink - of your Subnetwork' + be specified in two ways. First, you can place in the selfLink of the + resource here as a string Alternatively, you can add `register: name-of-resource` + to a gcp_compute_subnetwork task and then set this subnetwork field + to "{{ name-of-resource }}"' required: false scheduling: description: @@ -643,7 +641,7 @@ properties: - Note that for InstanceTemplate, specify the disk name, not the URL for the disk. returned: success - type: dict + type: str type: description: - Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, @@ -716,7 +714,7 @@ properties: IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. returned: success - type: dict + type: str type: description: - The type of configuration. The default and only option is ONE_TO_ONE_NAT. @@ -758,7 +756,7 @@ properties: default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. returned: success - type: dict + type: str networkIP: description: - An IPv4 internal network address to assign to the instance for this network @@ -773,7 +771,7 @@ properties: If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. returned: success - type: dict + type: str scheduling: description: - Sets the scheduling options for this instance. @@ -893,7 +891,7 @@ def main(): )), interface=dict(type='str', choices=['SCSI', 'NVME']), mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']), - source=dict(type='dict'), + source=dict(), type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']) )), machine_type=dict(required=True, type='str'), @@ -906,7 +904,7 @@ def main(): network_interfaces=dict(type='list', elements='dict', options=dict( access_configs=dict(type='list', elements='dict', options=dict( name=dict(required=True, type='str'), - nat_ip=dict(type='dict'), + nat_ip=dict(), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT']) )), alias_ip_ranges=dict(type='list', elements='dict', options=dict( @@ -914,9 +912,9 @@ def main(): subnetwork_range_name=dict(type='str') )), name=dict(type='str'), - network=dict(type='dict'), + network=dict(), network_ip=dict(type='str'), - subnetwork=dict(type='dict') + subnetwork=dict() )), scheduling=dict(type='dict', options=dict( automatic_restart=dict(type='bool'), diff --git a/plugins/modules/gcp_compute_instance_template_facts.py b/plugins/modules/gcp_compute_instance_template_facts.py index 7f3e56e..00d3509 100644 --- a/plugins/modules/gcp_compute_instance_template_facts.py +++ b/plugins/modules/gcp_compute_instance_template_facts.py @@ -250,7 +250,7 @@ items: - Note that for InstanceTemplate, specify the disk name, not the URL for the disk. returned: success - type: dict + type: str type: description: - Specifies the type of the disk, either SCRATCH or PERSISTENT. If not @@ -326,7 +326,7 @@ items: ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. returned: success - type: dict + type: str type: description: - The type of configuration. The default and only option is ONE_TO_ONE_NAT. @@ -370,7 +370,7 @@ items: the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. returned: success - type: dict + type: str networkIP: description: - An IPv4 internal network address to assign to the instance for this @@ -386,7 +386,7 @@ items: optional. If the network is in custom subnet mode, then this field should be specified. returned: success - type: dict + type: str scheduling: description: - Sets the scheduling options for this instance. diff --git a/plugins/modules/gcp_compute_interconnect_attachment.py b/plugins/modules/gcp_compute_interconnect_attachment.py index 0e0f130..fbead26 100644 --- a/plugins/modules/gcp_compute_interconnect_attachment.py +++ b/plugins/modules/gcp_compute_interconnect_attachment.py @@ -65,10 +65,9 @@ options: will automatically connect the Interconnect to the network & region within which the Cloud Router is configured. - 'This field represents a link to a Router resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_router - task and then set this router field to "{{ name-of-resource }}" Alternatively, - you can set this router to a dictionary with the selfLink key where the value - is the selfLink of your Router' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_router + task and then set this router field to "{{ name-of-resource }}"' required: true name: description: @@ -150,7 +149,7 @@ router: automatically connect the Interconnect to the network & region within which the Cloud Router is configured. returned: success - type: dict + type: str creationTimestamp: description: - Creation timestamp in RFC3339 text format. @@ -200,7 +199,7 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), interconnect=dict(required=True, type='str'), description=dict(type='str'), - router=dict(required=True, type='dict'), + router=dict(required=True), name=dict(required=True, type='str'), region=dict(required=True, type='str') ) diff --git a/plugins/modules/gcp_compute_interconnect_attachment_facts.py b/plugins/modules/gcp_compute_interconnect_attachment_facts.py index 3f8d3dc..7a62962 100644 --- a/plugins/modules/gcp_compute_interconnect_attachment_facts.py +++ b/plugins/modules/gcp_compute_interconnect_attachment_facts.py @@ -119,7 +119,7 @@ items: will automatically connect the Interconnect to the network & region within which the Cloud Router is configured. returned: success - type: dict + type: str creationTimestamp: description: - Creation timestamp in RFC3339 text format. diff --git a/plugins/modules/gcp_compute_region_disk.py b/plugins/modules/gcp_compute_region_disk.py index 4b35852..378a6aa 100644 --- a/plugins/modules/gcp_compute_region_disk.py +++ b/plugins/modules/gcp_compute_region_disk.py @@ -129,10 +129,9 @@ options: - The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. - 'This field represents a link to a Snapshot resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_snapshot - task and then set this source_snapshot field to "{{ name-of-resource }}" Alternatively, - you can set this source_snapshot to a dictionary with the selfLink key where - the value is the selfLink of your Snapshot' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_snapshot + task and then set this source_snapshot field to "{{ name-of-resource }}"' required: false source_snapshot_encryption_key: description: @@ -288,7 +287,7 @@ sourceSnapshot: - The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. returned: success - type: dict + type: str sourceSnapshotEncryptionKey: description: - The customer-supplied encryption key of the source snapshot. Required if the source @@ -351,7 +350,7 @@ def main(): raw_key=dict(type='str'), sha256=dict(type='str') )), - source_snapshot=dict(type='dict'), + source_snapshot=dict(), source_snapshot_encryption_key=dict(type='dict', options=dict( raw_key=dict(type='str'), sha256=dict(type='str') diff --git a/plugins/modules/gcp_compute_region_disk_facts.py b/plugins/modules/gcp_compute_region_disk_facts.py index 6d13a1e..69b3cb5 100644 --- a/plugins/modules/gcp_compute_region_disk_facts.py +++ b/plugins/modules/gcp_compute_region_disk_facts.py @@ -185,7 +185,7 @@ items: - The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. returned: success - type: dict + type: str sourceSnapshotEncryptionKey: description: - The customer-supplied encryption key of the source snapshot. Required if the diff --git a/plugins/modules/gcp_compute_route.py b/plugins/modules/gcp_compute_route.py index cb9a900..8f6e636 100644 --- a/plugins/modules/gcp_compute_route.py +++ b/plugins/modules/gcp_compute_route.py @@ -86,10 +86,9 @@ options: description: - The network that this route applies to. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: true priority: description: @@ -184,7 +183,7 @@ network: description: - The network that this route applies to. returned: success - type: dict + type: str priority: description: - The priority of this route. Priority is used to break ties in cases where there @@ -255,7 +254,7 @@ def main(): dest_range=dict(required=True, type='str'), description=dict(type='str'), name=dict(required=True, type='str'), - network=dict(required=True, type='dict'), + network=dict(required=True), priority=dict(type='int'), tags=dict(type='list', elements='str'), next_hop_gateway=dict(type='str'), diff --git a/plugins/modules/gcp_compute_route_facts.py b/plugins/modules/gcp_compute_route_facts.py index 93e41d9..dd7fae9 100644 --- a/plugins/modules/gcp_compute_route_facts.py +++ b/plugins/modules/gcp_compute_route_facts.py @@ -90,7 +90,7 @@ items: description: - The network that this route applies to. returned: success - type: dict + type: str priority: description: - The priority of this route. Priority is used to break ties in cases where diff --git a/plugins/modules/gcp_compute_router.py b/plugins/modules/gcp_compute_router.py index e0d5888..ff8be5f 100644 --- a/plugins/modules/gcp_compute_router.py +++ b/plugins/modules/gcp_compute_router.py @@ -63,10 +63,9 @@ options: description: - A reference to the network to which this router belongs. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: true bgp: description: @@ -182,7 +181,7 @@ network: description: - A reference to the network to which this router belongs. returned: success - type: dict + type: str bgp: description: - BGP information specific to this router. @@ -259,17 +258,17 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), name=dict(required=True, type='str'), description=dict(type='str'), - network=dict(required=True, type='dict'), - bgp=dict( - type='dict', - options=dict( - asn=dict(required=True, type='int'), - advertise_mode=dict(default='DEFAULT', type='str', choices=['DEFAULT', 'CUSTOM']), - advertised_groups=dict(type='list', elements='str'), - advertised_ip_ranges=dict(type='list', elements='dict', options=dict(range=dict(type='str'), description=dict(type='str'))), - ), - ), - region=dict(required=True, type='str'), + network=dict(required=True), + bgp=dict(type='dict', options=dict( + asn=dict(required=True, type='int'), + advertise_mode=dict(default='DEFAULT', type='str', choices=['DEFAULT', 'CUSTOM']), + advertised_groups=dict(type='list', elements='str'), + advertised_ip_ranges=dict(type='list', elements='dict', options=dict( + range=dict(type='str'), + description=dict(type='str') + )) + )), + region=dict(required=True, type='str') ) ) diff --git a/plugins/modules/gcp_compute_router_facts.py b/plugins/modules/gcp_compute_router_facts.py index 25f3967..cb6ac00 100644 --- a/plugins/modules/gcp_compute_router_facts.py +++ b/plugins/modules/gcp_compute_router_facts.py @@ -97,7 +97,7 @@ items: description: - A reference to the network to which this router belongs. returned: success - type: dict + type: str bgp: description: - BGP information specific to this router. diff --git a/plugins/modules/gcp_compute_subnetwork.py b/plugins/modules/gcp_compute_subnetwork.py index e3d8921..38f7211 100644 --- a/plugins/modules/gcp_compute_subnetwork.py +++ b/plugins/modules/gcp_compute_subnetwork.py @@ -89,10 +89,9 @@ options: - The network this subnet belongs to. - Only networks that are in the distributed mode can have subnetworks. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: true enable_flow_logs: description: @@ -207,7 +206,7 @@ network: - The network this subnet belongs to. - Only networks that are in the distributed mode can have subnetworks. returned: success - type: dict + type: str enableFlowLogs: description: - Whether to enable flow logging for this subnetwork. @@ -277,7 +276,7 @@ def main(): description=dict(type='str'), ip_cidr_range=dict(required=True, type='str'), name=dict(required=True, type='str'), - network=dict(required=True, type='dict'), + network=dict(required=True), enable_flow_logs=dict(type='bool'), secondary_ip_ranges=dict(type='list', elements='dict', options=dict( range_name=dict(required=True, type='str'), diff --git a/plugins/modules/gcp_compute_subnetwork_facts.py b/plugins/modules/gcp_compute_subnetwork_facts.py index b7946ee..4ea3b9f 100644 --- a/plugins/modules/gcp_compute_subnetwork_facts.py +++ b/plugins/modules/gcp_compute_subnetwork_facts.py @@ -114,7 +114,7 @@ items: - The network this subnet belongs to. - Only networks that are in the distributed mode can have subnetworks. returned: success - type: dict + type: str enableFlowLogs: description: - Whether to enable flow logging for this subnetwork. diff --git a/plugins/modules/gcp_compute_target_http_proxy.py b/plugins/modules/gcp_compute_target_http_proxy.py index 0e39917..b615171 100644 --- a/plugins/modules/gcp_compute_target_http_proxy.py +++ b/plugins/modules/gcp_compute_target_http_proxy.py @@ -66,10 +66,9 @@ options: - A reference to the UrlMap resource that defines the mapping from URL to the BackendService. - 'This field represents a link to a UrlMap resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_url_map - task and then set this url_map field to "{{ name-of-resource }}" Alternatively, - you can set this url_map to a dictionary with the selfLink key where the value - is the selfLink of your UrlMap' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_url_map + task and then set this url_map field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp notes: @@ -165,7 +164,7 @@ urlMap: description: - A reference to the UrlMap resource that defines the mapping from URL to the BackendService. returned: success - type: dict + type: str ''' ################################################################################ @@ -189,7 +188,7 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), description=dict(type='str'), name=dict(required=True, type='str'), - url_map=dict(required=True, type='dict'), + url_map=dict(required=True) ) ) diff --git a/plugins/modules/gcp_compute_target_http_proxy_facts.py b/plugins/modules/gcp_compute_target_http_proxy_facts.py index f480f91..8b48988 100644 --- a/plugins/modules/gcp_compute_target_http_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_http_proxy_facts.py @@ -94,7 +94,7 @@ items: - A reference to the UrlMap resource that defines the mapping from URL to the BackendService. returned: success - type: dict + type: str ''' ################################################################################ diff --git a/plugins/modules/gcp_compute_target_https_proxy.py b/plugins/modules/gcp_compute_target_https_proxy.py index 5e05f2b..bffd851 100644 --- a/plugins/modules/gcp_compute_target_https_proxy.py +++ b/plugins/modules/gcp_compute_target_https_proxy.py @@ -86,10 +86,9 @@ options: resource. If not set, the TargetHttpsProxy resource will not have any SSL policy configured. - 'This field represents a link to a SslPolicy resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_ssl_policy - task and then set this ssl_policy field to "{{ name-of-resource }}" Alternatively, - you can set this ssl_policy to a dictionary with the selfLink key where the - value is the selfLink of your SslPolicy' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_ssl_policy + task and then set this ssl_policy field to "{{ name-of-resource }}"' required: false version_added: 2.8 url_map: @@ -97,10 +96,9 @@ options: - A reference to the UrlMap resource that defines the mapping from URL to the BackendService. - 'This field represents a link to a UrlMap resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_url_map - task and then set this url_map field to "{{ name-of-resource }}" Alternatively, - you can set this url_map to a dictionary with the selfLink key where the value - is the selfLink of your UrlMap' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_url_map + task and then set this url_map field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp notes: @@ -237,12 +235,12 @@ sslPolicy: resource. If not set, the TargetHttpsProxy resource will not have any SSL policy configured. returned: success - type: dict + type: str urlMap: description: - A reference to the UrlMap resource that defines the mapping from URL to the BackendService. returned: success - type: dict + type: str ''' ################################################################################ @@ -267,9 +265,9 @@ def main(): description=dict(type='str'), name=dict(required=True, type='str'), quic_override=dict(type='str', choices=['NONE', 'ENABLE', 'DISABLE']), - ssl_certificates=dict(required=True, type='list', elements='dict'), - ssl_policy=dict(type='dict'), - url_map=dict(required=True, type='dict') + ssl_certificates=dict(required=True, type='list'), + ssl_policy=dict(), + url_map=dict(required=True) ) ) diff --git a/plugins/modules/gcp_compute_target_https_proxy_facts.py b/plugins/modules/gcp_compute_target_https_proxy_facts.py index cfc3983..392a81c 100644 --- a/plugins/modules/gcp_compute_target_https_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_https_proxy_facts.py @@ -111,13 +111,13 @@ items: resource. If not set, the TargetHttpsProxy resource will not have any SSL policy configured. returned: success - type: dict + type: str urlMap: description: - A reference to the UrlMap resource that defines the mapping from URL to the BackendService. returned: success - type: dict + type: str ''' ################################################################################ diff --git a/plugins/modules/gcp_compute_target_pool.py b/plugins/modules/gcp_compute_target_pool.py index 778926d..5cecd07 100644 --- a/plugins/modules/gcp_compute_target_pool.py +++ b/plugins/modules/gcp_compute_target_pool.py @@ -61,10 +61,9 @@ options: pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. - 'This field represents a link to a TargetPool resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_target_pool - task and then set this backup_pool field to "{{ name-of-resource }}" Alternatively, - you can set this backup_pool to a dictionary with the selfLink key where the - value is the selfLink of your TargetPool' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_target_pool + task and then set this backup_pool field to "{{ name-of-resource }}"' required: false description: description: @@ -91,10 +90,10 @@ options: checks pass. If not specified it means all member instances will be considered healthy at all times. - 'This field represents a link to a HttpHealthCheck resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_compute_http_health_check - task and then set this health_check field to "{{ name-of-resource }}" Alternatively, - you can set this health_check to a dictionary with the selfLink key where the - value is the selfLink of your HttpHealthCheck' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_http_health_check task and then set this health_check field to + "{{ name-of-resource }}"' required: false instances: description: @@ -159,7 +158,7 @@ backupPool: pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. returned: success - type: dict + type: str creationTimestamp: description: - Creation timestamp in RFC3339 text format. @@ -192,7 +191,7 @@ healthCheck: checks pass. If not specified it means all member instances will be considered healthy at all times. returned: success - type: dict + type: str id: description: - The unique identifier for the resource. @@ -250,11 +249,11 @@ def main(): module = GcpModule( argument_spec=dict( state=dict(default='present', choices=['present', 'absent'], type='str'), - backup_pool=dict(type='dict'), + backup_pool=dict(), description=dict(type='str'), failover_ratio=dict(type='str'), - health_check=dict(type='dict'), - instances=dict(type='list', elements='dict'), + health_check=dict(), + instances=dict(type='list'), name=dict(required=True, type='str'), session_affinity=dict(type='str', choices=['NONE', 'CLIENT_IP', 'CLIENT_IP_PROTO']), region=dict(required=True, type='str'), diff --git a/plugins/modules/gcp_compute_target_pool_facts.py b/plugins/modules/gcp_compute_target_pool_facts.py index 07eaf81..fee2283 100644 --- a/plugins/modules/gcp_compute_target_pool_facts.py +++ b/plugins/modules/gcp_compute_target_pool_facts.py @@ -83,7 +83,7 @@ items: primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. returned: success - type: dict + type: str creationTimestamp: description: - Creation timestamp in RFC3339 text format. @@ -116,7 +116,7 @@ items: checks pass. If not specified it means all member instances will be considered healthy at all times. returned: success - type: dict + type: str id: description: - The unique identifier for the resource. diff --git a/plugins/modules/gcp_compute_target_ssl_proxy.py b/plugins/modules/gcp_compute_target_ssl_proxy.py index aef1f15..d838f76 100644 --- a/plugins/modules/gcp_compute_target_ssl_proxy.py +++ b/plugins/modules/gcp_compute_target_ssl_proxy.py @@ -73,10 +73,10 @@ options: description: - A reference to the BackendService resource. - 'This field represents a link to a BackendService resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_compute_backend_service - task and then set this service field to "{{ name-of-resource }}" Alternatively, - you can set this service to a dictionary with the selfLink key where the value - is the selfLink of your BackendService' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_backend_service task and then set this service field to "{{ name-of-resource + }}"' required: true ssl_certificates: description: @@ -90,10 +90,9 @@ options: resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. - 'This field represents a link to a SslPolicy resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_ssl_policy - task and then set this ssl_policy field to "{{ name-of-resource }}" Alternatively, - you can set this ssl_policy to a dictionary with the selfLink key where the - value is the selfLink of your SslPolicy' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_ssl_policy + task and then set this ssl_policy field to "{{ name-of-resource }}"' required: false version_added: 2.8 extends_documentation_fragment: gcp @@ -214,7 +213,7 @@ service: description: - A reference to the BackendService resource. returned: success - type: dict + type: str sslCertificates: description: - A list of SslCertificate resources that are used to authenticate connections between @@ -227,7 +226,7 @@ sslPolicy: resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. returned: success - type: dict + type: str ''' ################################################################################ @@ -252,9 +251,9 @@ def main(): description=dict(type='str'), name=dict(required=True, type='str'), proxy_header=dict(type='str', choices=['NONE', 'PROXY_V1']), - service=dict(required=True, type='dict'), - ssl_certificates=dict(required=True, type='list', elements='dict'), - ssl_policy=dict(type='dict') + service=dict(required=True), + ssl_certificates=dict(required=True, type='list'), + ssl_policy=dict() ) ) diff --git a/plugins/modules/gcp_compute_target_ssl_proxy_facts.py b/plugins/modules/gcp_compute_target_ssl_proxy_facts.py index 9c12ba1..8b30f20 100644 --- a/plugins/modules/gcp_compute_target_ssl_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_ssl_proxy_facts.py @@ -99,7 +99,7 @@ items: description: - A reference to the BackendService resource. returned: success - type: dict + type: str sslCertificates: description: - A list of SslCertificate resources that are used to authenticate connections @@ -113,7 +113,7 @@ items: resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. returned: success - type: dict + type: str ''' ################################################################################ diff --git a/plugins/modules/gcp_compute_target_tcp_proxy.py b/plugins/modules/gcp_compute_target_tcp_proxy.py index 73931e1..196da89 100644 --- a/plugins/modules/gcp_compute_target_tcp_proxy.py +++ b/plugins/modules/gcp_compute_target_tcp_proxy.py @@ -73,10 +73,10 @@ options: description: - A reference to the BackendService resource. - 'This field represents a link to a BackendService resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_compute_backend_service - task and then set this service field to "{{ name-of-resource }}" Alternatively, - you can set this service to a dictionary with the selfLink key where the value - is the selfLink of your BackendService' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_backend_service task and then set this service field to "{{ name-of-resource + }}"' required: true extends_documentation_fragment: gcp notes: @@ -173,7 +173,7 @@ service: description: - A reference to the BackendService resource. returned: success - type: dict + type: str ''' ################################################################################ @@ -198,7 +198,7 @@ def main(): description=dict(type='str'), name=dict(required=True, type='str'), proxy_header=dict(type='str', choices=['NONE', 'PROXY_V1']), - service=dict(required=True, type='dict'), + service=dict(required=True) ) ) diff --git a/plugins/modules/gcp_compute_target_tcp_proxy_facts.py b/plugins/modules/gcp_compute_target_tcp_proxy_facts.py index 88839e1..35d1f4f 100644 --- a/plugins/modules/gcp_compute_target_tcp_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_tcp_proxy_facts.py @@ -99,7 +99,7 @@ items: description: - A reference to the BackendService resource. returned: success - type: dict + type: str ''' ################################################################################ diff --git a/plugins/modules/gcp_compute_target_vpn_gateway.py b/plugins/modules/gcp_compute_target_vpn_gateway.py index ae98e41..f1a411b 100644 --- a/plugins/modules/gcp_compute_target_vpn_gateway.py +++ b/plugins/modules/gcp_compute_target_vpn_gateway.py @@ -65,10 +65,9 @@ options: description: - The network this VPN gateway is accepting traffic for. - 'This field represents a link to a Network resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_network - task and then set this network field to "{{ name-of-resource }}" Alternatively, - you can set this network to a dictionary with the selfLink key where the value - is the selfLink of your Network' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network + task and then set this network field to "{{ name-of-resource }}"' required: true region: description: @@ -140,7 +139,7 @@ network: description: - The network this VPN gateway is accepting traffic for. returned: success - type: dict + type: str tunnels: description: - A list of references to VpnTunnel resources associated to this VPN gateway. @@ -179,8 +178,8 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), description=dict(type='str'), name=dict(required=True, type='str'), - network=dict(required=True, type='dict'), - region=dict(required=True, type='str'), + network=dict(required=True), + region=dict(required=True, type='str') ) ) diff --git a/plugins/modules/gcp_compute_target_vpn_gateway_facts.py b/plugins/modules/gcp_compute_target_vpn_gateway_facts.py index 0809e99..b00033a 100644 --- a/plugins/modules/gcp_compute_target_vpn_gateway_facts.py +++ b/plugins/modules/gcp_compute_target_vpn_gateway_facts.py @@ -98,7 +98,7 @@ items: description: - The network this VPN gateway is accepting traffic for. returned: success - type: dict + type: str tunnels: description: - A list of references to VpnTunnel resources associated to this VPN gateway. diff --git a/plugins/modules/gcp_compute_url_map.py b/plugins/modules/gcp_compute_url_map.py index 2cff11a..170bd00 100644 --- a/plugins/modules/gcp_compute_url_map.py +++ b/plugins/modules/gcp_compute_url_map.py @@ -52,10 +52,10 @@ options: description: - A reference to BackendService resource if none of the hostRules match. - 'This field represents a link to a BackendService resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_compute_backend_service - task and then set this default_service field to "{{ name-of-resource }}" Alternatively, - you can set this default_service to a dictionary with the selfLink key where - the value is the selfLink of your BackendService' + specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_backend_service task and then set this default_service field to + "{{ name-of-resource }}"' required: true description: description: @@ -102,11 +102,10 @@ options: - A reference to a BackendService resource. This will be used if none of the pathRules defined by this PathMatcher is matched by the URL's path portion. - 'This field represents a link to a BackendService resource in GCP. It can - be specified in two ways. You can add `register: name-of-resource` to a - gcp_compute_backend_service task and then set this default_service field - to "{{ name-of-resource }}" Alternatively, you can set this default_service - to a dictionary with the selfLink key where the value is the selfLink of - your BackendService' + be specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` + to a gcp_compute_backend_service task and then set this default_service + field to "{{ name-of-resource }}"' required: true description: description: @@ -132,11 +131,10 @@ options: description: - A reference to the BackendService resource if this rule is matched. - 'This field represents a link to a BackendService resource in GCP. It - can be specified in two ways. You can add `register: name-of-resource` - to a gcp_compute_backend_service task and then set this service field - to "{{ name-of-resource }}" Alternatively, you can set this service - to a dictionary with the selfLink key where the value is the selfLink - of your BackendService' + can be specified in two ways. First, you can place in the selfLink of + the resource here as a string Alternatively, you can add `register: + name-of-resource` to a gcp_compute_backend_service task and then set + this service field to "{{ name-of-resource }}"' required: true tests: description: @@ -161,10 +159,10 @@ options: - A reference to expected BackendService resource the given URL should be mapped to. - 'This field represents a link to a BackendService resource in GCP. It can - be specified in two ways. You can add `register: name-of-resource` to a - gcp_compute_backend_service task and then set this service field to "{{ - name-of-resource }}" Alternatively, you can set this service to a dictionary - with the selfLink key where the value is the selfLink of your BackendService' + be specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` + to a gcp_compute_backend_service task and then set this service field to + "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -227,7 +225,7 @@ defaultService: description: - A reference to BackendService resource if none of the hostRules match. returned: success - type: dict + type: str description: description: - An optional description of this resource. Provide this property when you create @@ -291,7 +289,7 @@ pathMatchers: - A reference to a BackendService resource. This will be used if none of the pathRules defined by this PathMatcher is matched by the URL's path portion. returned: success - type: dict + type: str description: description: - An optional description of this resource. @@ -320,7 +318,7 @@ pathMatchers: description: - A reference to the BackendService resource if this rule is matched. returned: success - type: dict + type: str tests: description: - The list of expected URL mappings. Requests to update this UrlMap will succeed @@ -348,7 +346,7 @@ tests: - A reference to expected BackendService resource the given URL should be mapped to. returned: success - type: dict + type: str ''' ################################################################################ @@ -370,7 +368,7 @@ def main(): module = GcpModule( argument_spec=dict( state=dict(default='present', choices=['present', 'absent'], type='str'), - default_service=dict(required=True, type='dict'), + default_service=dict(required=True), description=dict(type='str'), host_rules=dict(type='list', elements='dict', options=dict( description=dict(type='str'), @@ -379,19 +377,19 @@ def main(): )), name=dict(required=True, type='str'), path_matchers=dict(type='list', elements='dict', options=dict( - default_service=dict(required=True, type='dict'), + default_service=dict(required=True), description=dict(type='str'), name=dict(required=True, type='str'), path_rules=dict(type='list', elements='dict', options=dict( paths=dict(required=True, type='list', elements='str'), - service=dict(required=True, type='dict') + service=dict(required=True) )) )), tests=dict(type='list', elements='dict', options=dict( description=dict(type='str'), host=dict(required=True, type='str'), path=dict(required=True, type='str'), - service=dict(required=True, type='dict') + service=dict(required=True) )) ) ) diff --git a/plugins/modules/gcp_compute_url_map_facts.py b/plugins/modules/gcp_compute_url_map_facts.py index 543219d..3c9acb3 100644 --- a/plugins/modules/gcp_compute_url_map_facts.py +++ b/plugins/modules/gcp_compute_url_map_facts.py @@ -73,7 +73,7 @@ items: description: - A reference to BackendService resource if none of the hostRules match. returned: success - type: dict + type: str description: description: - An optional description of this resource. Provide this property when you create @@ -138,7 +138,7 @@ items: the pathRules defined by this PathMatcher is matched by the URL's path portion. returned: success - type: dict + type: str description: description: - An optional description of this resource. @@ -167,7 +167,7 @@ items: description: - A reference to the BackendService resource if this rule is matched. returned: success - type: dict + type: str tests: description: - The list of expected URL mappings. Requests to update this UrlMap will succeed @@ -195,7 +195,7 @@ items: - A reference to expected BackendService resource the given URL should be mapped to. returned: success - type: dict + type: str ''' ################################################################################ diff --git a/plugins/modules/gcp_compute_vpn_tunnel.py b/plugins/modules/gcp_compute_vpn_tunnel.py index a678312..c86c8c4 100644 --- a/plugins/modules/gcp_compute_vpn_tunnel.py +++ b/plugins/modules/gcp_compute_vpn_tunnel.py @@ -63,19 +63,18 @@ options: description: - URL of the Target VPN gateway with which this VPN tunnel is associated. - 'This field represents a link to a TargetVpnGateway resource in GCP. It can - be specified in two ways. You can add `register: name-of-resource` to a gcp_compute_target_vpn_gateway - task and then set this target_vpn_gateway field to "{{ name-of-resource }}" - Alternatively, you can set this target_vpn_gateway to a dictionary with the - selfLink key where the value is the selfLink of your TargetVpnGateway' + be specified in two ways. First, you can place in the selfLink of the resource + here as a string Alternatively, you can add `register: name-of-resource` to + a gcp_compute_target_vpn_gateway task and then set this target_vpn_gateway field + to "{{ name-of-resource }}"' required: true router: description: - URL of router resource to be used for dynamic routing. - 'This field represents a link to a Router resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_compute_router - task and then set this router field to "{{ name-of-resource }}" Alternatively, - you can set this router to a dictionary with the selfLink key where the value - is the selfLink of your Router' + in two ways. First, you can place in the selfLink of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_compute_router + task and then set this router field to "{{ name-of-resource }}"' required: false peer_ip: description: @@ -198,12 +197,12 @@ targetVpnGateway: description: - URL of the Target VPN gateway with which this VPN tunnel is associated. returned: success - type: dict + type: str router: description: - URL of router resource to be used for dynamic routing. returned: success - type: dict + type: str peerIp: description: - IP address of the peer VPN gateway. Only IPv4 is supported. @@ -281,8 +280,8 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), name=dict(required=True, type='str'), description=dict(type='str'), - target_vpn_gateway=dict(required=True, type='dict'), - router=dict(type='dict'), + target_vpn_gateway=dict(required=True), + router=dict(), peer_ip=dict(required=True, type='str'), shared_secret=dict(required=True, type='str'), ike_version=dict(default=2, type='int'), diff --git a/plugins/modules/gcp_compute_vpn_tunnel_facts.py b/plugins/modules/gcp_compute_vpn_tunnel_facts.py index b78e164..1d504d3 100644 --- a/plugins/modules/gcp_compute_vpn_tunnel_facts.py +++ b/plugins/modules/gcp_compute_vpn_tunnel_facts.py @@ -92,12 +92,12 @@ items: description: - URL of the Target VPN gateway with which this VPN tunnel is associated. returned: success - type: dict + type: str router: description: - URL of router resource to be used for dynamic routing. returned: success - type: dict + type: str peerIp: description: - IP address of the peer VPN gateway. Only IPv4 is supported. diff --git a/plugins/modules/gcp_container_node_pool.py b/plugins/modules/gcp_container_node_pool.py index 9d0a93d..c2b116f 100644 --- a/plugins/modules/gcp_container_node_pool.py +++ b/plugins/modules/gcp_container_node_pool.py @@ -203,10 +203,9 @@ options: description: - The cluster this node pool belongs to. - 'This field represents a link to a Cluster resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_container_cluster - task and then set this cluster field to "{{ name-of-resource }}" Alternatively, - you can set this cluster to a dictionary with the name key where the value is - the name of your Cluster' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_container_cluster + task and then set this cluster field to "{{ name-of-resource }}"' required: true zone: description: @@ -415,7 +414,7 @@ cluster: description: - The cluster this node pool belongs to. returned: success - type: dict + type: str zone: description: - The zone where the node pool is deployed. @@ -459,13 +458,21 @@ def main(): ), ), initial_node_count=dict(required=True, type='int'), - version=dict(type='str'), - autoscaling=dict(type='dict', options=dict(enabled=dict(type='bool'), min_node_count=dict(type='int'), max_node_count=dict(type='int'))), - management=dict( - type='dict', options=dict(auto_upgrade=dict(type='bool'), auto_repair=dict(type='bool'), upgrade_options=dict(type='dict', options=dict())) - ), - cluster=dict(required=True, type='dict'), - location=dict(required=True, type='str', aliases=['region', 'zone']), + autoscaling=dict(type='dict', options=dict( + enabled=dict(type='bool'), + min_node_count=dict(type='int'), + max_node_count=dict(type='int') + )), + management=dict(type='dict', options=dict( + auto_upgrade=dict(type='bool'), + auto_repair=dict(type='bool'), + upgrade_options=dict(type='dict', options=dict( + auto_upgrade_start_time=dict(type='str'), + description=dict(type='str') + )) + )), + cluster=dict(required=True), + zone=dict(required=True, type='str') ) ) diff --git a/plugins/modules/gcp_container_node_pool_facts.py b/plugins/modules/gcp_container_node_pool_facts.py index 343f7f8..48b33c2 100644 --- a/plugins/modules/gcp_container_node_pool_facts.py +++ b/plugins/modules/gcp_container_node_pool_facts.py @@ -49,10 +49,9 @@ options: description: - The cluster this node pool belongs to. - 'This field represents a link to a Cluster resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_container_cluster - task and then set this cluster field to "{{ name-of-resource }}" Alternatively, - you can set this cluster to a dictionary with the name key where the value is - the name of your Cluster' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_container_cluster + task and then set this cluster field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -249,7 +248,7 @@ items: description: - The cluster this node pool belongs to. returned: success - type: dict + type: str zone: description: - The zone where the node pool is deployed. @@ -272,7 +271,7 @@ def main(): module = GcpModule( argument_spec=dict( zone=dict(required=True, type='str'), - cluster=dict(required=True, type='dict') + cluster=dict(required=True) ) ) diff --git a/plugins/modules/gcp_dns_resource_record_set.py b/plugins/modules/gcp_dns_resource_record_set.py index 20dc2e7..0ef6af9 100644 --- a/plugins/modules/gcp_dns_resource_record_set.py +++ b/plugins/modules/gcp_dns_resource_record_set.py @@ -85,10 +85,9 @@ options: - Identifies the managed zone addressed by this request. - Can be the managed zone name or id. - 'This field represents a link to a ManagedZone resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_dns_managed_zone - task and then set this managed_zone field to "{{ name-of-resource }}" Alternatively, - you can set this managed_zone to a dictionary with the name key where the value - is the name of your ManagedZone' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_dns_managed_zone + task and then set this managed_zone field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -146,7 +145,7 @@ managed_zone: - Identifies the managed zone addressed by this request. - Can be the managed zone name or id. returned: success - type: dict + type: str ''' ################################################################################ @@ -174,7 +173,7 @@ def main(): type=dict(required=True, type='str', choices=['A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NAPTR', 'NS', 'PTR', 'SOA', 'SPF', 'SRV', 'TLSA', 'TXT']), ttl=dict(type='int'), target=dict(type='list', elements='str'), - managed_zone=dict(required=True, type='dict'), + managed_zone=dict(required=True) ) ) diff --git a/plugins/modules/gcp_dns_resource_record_set_facts.py b/plugins/modules/gcp_dns_resource_record_set_facts.py index f5fd0c3..7727f87 100644 --- a/plugins/modules/gcp_dns_resource_record_set_facts.py +++ b/plugins/modules/gcp_dns_resource_record_set_facts.py @@ -46,10 +46,9 @@ options: - Identifies the managed zone addressed by this request. - Can be the managed zone name or id. - 'This field represents a link to a ManagedZone resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_dns_managed_zone - task and then set this managed_zone field to "{{ name-of-resource }}" Alternatively, - you can set this managed_zone to a dictionary with the name key where the value - is the name of your ManagedZone' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_dns_managed_zone + task and then set this managed_zone field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -94,7 +93,7 @@ items: - Identifies the managed zone addressed by this request. - Can be the managed zone name or id. returned: success - type: dict + type: str ''' ################################################################################ @@ -111,7 +110,7 @@ import json def main(): module = GcpModule( argument_spec=dict( - managed_zone=dict(required=True, type='dict') + managed_zone=dict(required=True) ) ) diff --git a/plugins/modules/gcp_iam_service_account_key.py b/plugins/modules/gcp_iam_service_account_key.py index a5882f6..c842615 100644 --- a/plugins/modules/gcp_iam_service_account_key.py +++ b/plugins/modules/gcp_iam_service_account_key.py @@ -68,10 +68,9 @@ options: description: - The name of the serviceAccount. - 'This field represents a link to a ServiceAccount resource in GCP. It can be - specified in two ways. You can add `register: name-of-resource` to a gcp_iam_service_account - task and then set this service_account field to "{{ name-of-resource }}" Alternatively, - you can set this service_account to a dictionary with the name key where the - value is the name of your ServiceAccount' + specified in two ways. First, you can place in the name of the resource here + as a string Alternatively, you can add `register: name-of-resource` to a gcp_iam_service_account + task and then set this service_account field to "{{ name-of-resource }}"' required: false path: description: @@ -144,7 +143,7 @@ serviceAccount: description: - The name of the serviceAccount. returned: success - type: dict + type: str path: description: - The full name of the file that will hold the service account private key. The @@ -178,7 +177,7 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), private_key_type=dict(type='str', choices=['TYPE_UNSPECIFIED', 'TYPE_PKCS12_FILE', 'TYPE_GOOGLE_CREDENTIALS_FILE']), key_algorithm=dict(type='str', choices=['KEY_ALG_UNSPECIFIED', 'KEY_ALG_RSA_1024', 'KEY_ALG_RSA_2048']), - service_account=dict(type='dict'), + service_account=dict(), path=dict(type='path') ) ) diff --git a/plugins/modules/gcp_pubsub_subscription.py b/plugins/modules/gcp_pubsub_subscription.py index e7b6d4f..f9a596f 100644 --- a/plugins/modules/gcp_pubsub_subscription.py +++ b/plugins/modules/gcp_pubsub_subscription.py @@ -56,10 +56,9 @@ options: description: - A reference to a Topic resource. - 'This field represents a link to a Topic resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_pubsub_topic - task and then set this topic field to "{{ name-of-resource }}" Alternatively, - you can set this topic to a dictionary with the name key where the value is - the name of your Topic' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_pubsub_topic + task and then set this topic field to "{{ name-of-resource }}"' required: false push_config: description: @@ -127,7 +126,7 @@ topic: description: - A reference to a Topic resource. returned: success - type: dict + type: str pushConfig: description: - If push delivery is used with this subscription, this field is used to configure @@ -180,13 +179,12 @@ def main(): module = GcpModule( argument_spec=dict( state=dict(default='present', choices=['present', 'absent'], type='str'), - name=dict(required=True, type='str'), - topic=dict(required=True, type='dict'), - labels=dict(type='dict'), - push_config=dict(type='dict', options=dict(push_endpoint=dict(required=True, type='str'), attributes=dict(type='dict'))), - ack_deadline_seconds=dict(type='int'), - message_retention_duration=dict(default='604800s', type='str'), - retain_acked_messages=dict(type='bool'), + name=dict(type='str'), + topic=dict(), + push_config=dict(type='dict', options=dict( + push_endpoint=dict(type='str') + )), + ack_deadline_seconds=dict(type='int') ) ) diff --git a/plugins/modules/gcp_pubsub_subscription_facts.py b/plugins/modules/gcp_pubsub_subscription_facts.py index ea1f16d..50272b7 100644 --- a/plugins/modules/gcp_pubsub_subscription_facts.py +++ b/plugins/modules/gcp_pubsub_subscription_facts.py @@ -67,7 +67,7 @@ items: description: - A reference to a Topic resource. returned: success - type: dict + type: str pushConfig: description: - If push delivery is used with this subscription, this field is used to configure diff --git a/plugins/modules/gcp_spanner_database.py b/plugins/modules/gcp_spanner_database.py index 10e7758..beb767d 100644 --- a/plugins/modules/gcp_spanner_database.py +++ b/plugins/modules/gcp_spanner_database.py @@ -64,10 +64,9 @@ options: description: - The instance to create the database on. - 'This field represents a link to a Instance resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_spanner_instance - task and then set this instance field to "{{ name-of-resource }}" Alternatively, - you can set this instance to a dictionary with the name key where the value - is the name of your Instance' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_spanner_instance + task and then set this instance field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp notes: @@ -120,7 +119,7 @@ instance: description: - The instance to create the database on. returned: success - type: dict + type: str ''' ################################################################################ @@ -143,7 +142,7 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), name=dict(required=True, type='str'), extra_statements=dict(type='list', elements='str'), - instance=dict(required=True, type='dict'), + instance=dict(required=True) ) ) diff --git a/plugins/modules/gcp_spanner_database_facts.py b/plugins/modules/gcp_spanner_database_facts.py index 87e866a..d781a9e 100644 --- a/plugins/modules/gcp_spanner_database_facts.py +++ b/plugins/modules/gcp_spanner_database_facts.py @@ -45,10 +45,9 @@ options: description: - The instance to create the database on. - 'This field represents a link to a Instance resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_spanner_instance - task and then set this instance field to "{{ name-of-resource }}" Alternatively, - you can set this instance to a dictionary with the name key where the value - is the name of your Instance' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_spanner_instance + task and then set this instance field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -87,7 +86,7 @@ items: description: - The instance to create the database on. returned: success - type: dict + type: str ''' ################################################################################ @@ -104,7 +103,7 @@ import json def main(): module = GcpModule( argument_spec=dict( - instance=dict(required=True, type='dict') + instance=dict(required=True) ) ) diff --git a/plugins/modules/gcp_sql_database.py b/plugins/modules/gcp_sql_database.py index 1a8af8d..f78f11d 100644 --- a/plugins/modules/gcp_sql_database.py +++ b/plugins/modules/gcp_sql_database.py @@ -64,10 +64,9 @@ options: description: - The name of the Cloud SQL instance. This does not include the project ID. - 'This field represents a link to a Instance resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_sql_instance - task and then set this instance field to "{{ name-of-resource }}" Alternatively, - you can set this instance to a dictionary with the name key where the value - is the name of your Instance' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_sql_instance + task and then set this instance field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -121,7 +120,7 @@ instance: description: - The name of the Cloud SQL instance. This does not include the project ID. returned: success - type: dict + type: str ''' ################################################################################ @@ -145,8 +144,8 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), charset=dict(type='str'), collation=dict(type='str'), - name=dict(required=True, type='str'), - instance=dict(required=True, type='str'), + name=dict(type='str'), + instance=dict(required=True) ) ) diff --git a/plugins/modules/gcp_sql_database_facts.py b/plugins/modules/gcp_sql_database_facts.py index bebaf9c..cc4e6bb 100644 --- a/plugins/modules/gcp_sql_database_facts.py +++ b/plugins/modules/gcp_sql_database_facts.py @@ -45,10 +45,9 @@ options: description: - The name of the Cloud SQL instance. This does not include the project ID. - 'This field represents a link to a Instance resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_sql_instance - task and then set this instance field to "{{ name-of-resource }}" Alternatively, - you can set this instance to a dictionary with the name key where the value - is the name of your Instance' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_sql_instance + task and then set this instance field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -88,7 +87,7 @@ items: description: - The name of the Cloud SQL instance. This does not include the project ID. returned: success - type: dict + type: str ''' ################################################################################ @@ -105,7 +104,7 @@ import json def main(): module = GcpModule( argument_spec=dict( - instance=dict(required=True, type='dict') + instance=dict(required=True) ) ) diff --git a/plugins/modules/gcp_sql_user.py b/plugins/modules/gcp_sql_user.py index 31e5ef0..897d221 100644 --- a/plugins/modules/gcp_sql_user.py +++ b/plugins/modules/gcp_sql_user.py @@ -61,10 +61,9 @@ options: description: - The name of the Cloud SQL instance. This does not include the project ID. - 'This field represents a link to a Instance resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_sql_instance - task and then set this instance field to "{{ name-of-resource }}" Alternatively, - you can set this instance to a dictionary with the name key where the value - is the name of your Instance' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_sql_instance + task and then set this instance field to "{{ name-of-resource }}"' required: true password: description: @@ -119,7 +118,7 @@ instance: description: - The name of the Cloud SQL instance. This does not include the project ID. returned: success - type: dict + type: str password: description: - The password for the user. @@ -148,8 +147,8 @@ def main(): state=dict(default='present', choices=['present', 'absent'], type='str'), host=dict(required=True, type='str'), name=dict(required=True, type='str'), - instance=dict(required=True, type='dict'), - password=dict(type='str'), + instance=dict(required=True), + password=dict(type='str') ) ) diff --git a/plugins/modules/gcp_sql_user_facts.py b/plugins/modules/gcp_sql_user_facts.py index 9e89835..462efcb 100644 --- a/plugins/modules/gcp_sql_user_facts.py +++ b/plugins/modules/gcp_sql_user_facts.py @@ -45,10 +45,9 @@ options: description: - The name of the Cloud SQL instance. This does not include the project ID. - 'This field represents a link to a Instance resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_sql_instance - task and then set this instance field to "{{ name-of-resource }}" Alternatively, - you can set this instance to a dictionary with the name key where the value - is the name of your Instance' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_sql_instance + task and then set this instance field to "{{ name-of-resource }}"' required: true extends_documentation_fragment: gcp ''' @@ -84,7 +83,7 @@ items: description: - The name of the Cloud SQL instance. This does not include the project ID. returned: success - type: dict + type: str password: description: - The password for the user. @@ -106,7 +105,7 @@ import json def main(): module = GcpModule( argument_spec=dict( - instance=dict(required=True, type='dict') + instance=dict(required=True) ) ) diff --git a/plugins/modules/gcp_storage_bucket.py b/plugins/modules/gcp_storage_bucket.py index a98302c..4907bfc 100644 --- a/plugins/modules/gcp_storage_bucket.py +++ b/plugins/modules/gcp_storage_bucket.py @@ -61,10 +61,9 @@ options: description: - The name of the bucket. - 'This field represents a link to a Bucket resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_storage_bucket - task and then set this bucket field to "{{ name-of-resource }}" Alternatively, - you can set this bucket to a dictionary with the name key where the value - is the name of your Bucket' + in two ways. First, you can place in the name of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_storage_bucket + task and then set this bucket field to "{{ name-of-resource }}"' required: true domain: description: @@ -153,10 +152,9 @@ options: description: - The name of the bucket. - 'This field represents a link to a Bucket resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_storage_bucket - task and then set this bucket field to "{{ name-of-resource }}" Alternatively, - you can set this bucket to a dictionary with the name key where the value - is the name of your Bucket' + in two ways. First, you can place in the name of the resource here as a + string Alternatively, you can add `register: name-of-resource` to a gcp_storage_bucket + task and then set this bucket field to "{{ name-of-resource }}"' required: true domain: description: @@ -414,7 +412,7 @@ acl: description: - The name of the bucket. returned: success - type: dict + type: str domain: description: - The domain associated with the entity. @@ -508,7 +506,7 @@ defaultObjectAcl: description: - The name of the bucket. returned: success - type: dict + type: str domain: description: - The domain associated with the entity. @@ -792,7 +790,7 @@ def main(): argument_spec=dict( state=dict(default='present', choices=['present', 'absent'], type='str'), acl=dict(type='list', elements='dict', options=dict( - bucket=dict(required=True, type='dict'), + bucket=dict(required=True), domain=dict(type='str'), email=dict(type='str'), entity=dict(required=True, type='str'), @@ -811,7 +809,7 @@ def main(): response_header=dict(type='list', elements='str') )), default_object_acl=dict(type='list', elements='dict', options=dict( - bucket=dict(required=True, type='dict'), + bucket=dict(required=True), domain=dict(type='str'), email=dict(type='str'), entity=dict(required=True, type='str'), diff --git a/plugins/modules/gcp_storage_bucket_access_control.py b/plugins/modules/gcp_storage_bucket_access_control.py index 4c9e02c..d2fff86 100644 --- a/plugins/modules/gcp_storage_bucket_access_control.py +++ b/plugins/modules/gcp_storage_bucket_access_control.py @@ -60,10 +60,9 @@ options: description: - The name of the bucket. - 'This field represents a link to a Bucket resource in GCP. It can be specified - in two ways. You can add `register: name-of-resource` to a gcp_storage_bucket - task and then set this bucket field to "{{ name-of-resource }}" Alternatively, - you can set this bucket to a dictionary with the name key where the value is - the name of your Bucket' + in two ways. First, you can place in the name of the resource here as a string + Alternatively, you can add `register: name-of-resource` to a gcp_storage_bucket + task and then set this bucket field to "{{ name-of-resource }}"' required: true entity: description: @@ -132,7 +131,7 @@ bucket: description: - The name of the bucket. returned: success - type: dict + type: str domain: description: - The domain associated with the entity. @@ -204,7 +203,7 @@ def main(): module = GcpModule( argument_spec=dict( state=dict(default='present', choices=['present', 'absent'], type='str'), - bucket=dict(required=True, type='dict'), + bucket=dict(required=True), entity=dict(required=True, type='str'), entity_id=dict(type='str'), project_team=dict(type='dict', options=dict(project_number=dict(type='str'), team=dict(type='str', choices=['editors', 'owners', 'viewers']))),