Bug fixes for GCP (as of 2019-07-09T06:06:53Z) (#59131)

* Bug fixes for GCP modules
* ignore syntax
This commit is contained in:
The Magician 2019-07-22 21:31:47 -07:00 committed by Abhijeet Kasurde
parent b81239ce50
commit c6c262a07e
17 changed files with 89 additions and 15 deletions

View file

@ -49,6 +49,7 @@ options:
description:
- A reference to the region where the disk resides.
required: true
type: str
extends_documentation_fragment: gcp
'''

View file

@ -62,16 +62,19 @@ options:
- present
- absent
default: present
type: str
dest_range:
description:
- The destination range of outgoing packets that this route applies to.
- Only IPv4 is supported.
required: true
type: str
description:
description:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
version_added: 2.7
name:
description:
@ -82,6 +85,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
network:
description:
- The network that this route applies to.
@ -91,6 +95,7 @@ options:
to a gcp_compute_network task and then set this network field to "{{ name-of-resource
}}"'
required: true
type: dict
priority:
description:
- The priority of this route. Priority is used to break ties in cases where there
@ -99,10 +104,12 @@ options:
priority value wins.
- Default value is 1000. Valid range is 0 through 65535.
required: false
type: int
tags:
description:
- A list of instance tags to which this route applies.
required: false
type: list
next_hop_gateway:
description:
- URL to a gateway that should handle matching packets.
@ -111,6 +118,7 @@ options:
* projects/project/global/gateways/default-internet-gateway * global/gateways/default-internet-gateway
.'
required: false
type: str
next_hop_instance:
description:
- URL to an instance that should handle matching packets.
@ -123,10 +131,12 @@ options:
to a gcp_compute_instance task and then set this next_hop_instance field to
"{{ name-of-resource }}"'
required: false
type: dict
next_hop_ip:
description:
- Network IP address of an instance that should handle matching packets.
required: false
type: str
next_hop_vpn_tunnel:
description:
- URL to a VpnTunnel that should handle matching packets.
@ -136,6 +146,7 @@ options:
to a gcp_compute_vpn_tunnel task and then set this next_hop_vpn_tunnel field
to "{{ name-of-resource }}"'
required: false
type: dict
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/routes)'

View file

@ -47,6 +47,7 @@ options:
- present
- absent
default: present
type: str
name:
description:
- Name of the resource. The name must be 1-63 characters long, and comply with
@ -55,10 +56,12 @@ options:
be a lowercase letter, and all following characters must be a dash, lowercase
letter, or digit, except the last character, which cannot be a dash.
required: true
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
network:
description:
- A reference to the network to which this router belongs.
@ -68,10 +71,12 @@ options:
to a gcp_compute_network task and then set this network field to "{{ name-of-resource
}}"'
required: true
type: dict
bgp:
description:
- BGP information specific to this router.
required: false
type: dict
suboptions:
asn:
description:
@ -79,6 +84,7 @@ options:
either 16-bit or 32-bit. The value will be fixed for this router resource.
All VPN tunnels that link to this router will have the same local ASN.
required: true
type: int
advertise_mode:
description:
- User-specified flag to indicate which mode to use for advertisement.
@ -86,6 +92,7 @@ options:
- 'Some valid choices include: "DEFAULT", "CUSTOM"'
required: false
default: DEFAULT
type: str
advertised_groups:
description:
- User-specified list of prefix groups to advertise in custom mode.
@ -95,6 +102,7 @@ options:
groups.
- 'This enum field has the one valid value: ALL_SUBNETS .'
required: false
type: list
advertised_ip_ranges:
description:
- User-specified list of individual IP ranges to advertise in custom mode.
@ -103,19 +111,23 @@ options:
to any specified groups.
- Leave this field blank to advertise no custom IP ranges.
required: false
type: list
suboptions:
range:
description:
- The IP range to advertise. The value must be a CIDR-formatted string.
required: false
type: str
description:
description:
- User-specified description for the IP range.
required: false
type: str
region:
description:
- Region where the router resides.
required: true
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/routers)'

View file

@ -49,6 +49,7 @@ options:
description:
- Region where the router resides.
required: true
type: str
extends_documentation_fragment: gcp
'''

View file

@ -49,16 +49,19 @@ options:
- present
- absent
default: present
type: str
certificate:
description:
- The certificate in PEM format.
- The certificate chain must be no greater than 5 certs long.
- The chain must include at least one intermediate cert.
required: true
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -68,10 +71,12 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: false
type: str
private_key:
description:
- The write-only private key in PEM format.
required: true
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/sslCertificates)'

View file

@ -48,10 +48,12 @@ options:
- present
- absent
default: present
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -61,6 +63,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
profile:
description:
- Profile specifies the set of SSL features that can be used by the load balancer
@ -69,6 +72,7 @@ options:
must be specified in the `customFeatures` field.
- 'Some valid choices include: "COMPATIBLE", "MODERN", "RESTRICTED", "CUSTOM"'
required: false
type: str
min_tls_version:
description:
- The minimum version of SSL protocol that can be used by the clients to establish
@ -76,12 +80,14 @@ options:
`TLS_1_2`.
- 'Some valid choices include: "TLS_1_0", "TLS_1_1", "TLS_1_2"'
required: false
type: str
custom_features:
description:
- A list of features enabled when the selected profile is CUSTOM. The method returns
the set of features that can be specified in this list. This field must be empty
if the profile is not CUSTOM.
required: false
type: list
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/sslPolicies)'

View file

@ -63,11 +63,13 @@ options:
- present
- absent
default: present
type: str
description:
description:
- An optional description of this resource. Provide this property when you create
the resource. This field can be set only at resource creation time.
required: false
type: str
ip_cidr_range:
description:
- The range of internal addresses that are owned by this subnetwork.
@ -75,6 +77,7 @@ options:
or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network.
Only IPv4 is supported.
required: true
type: str
name:
description:
- The name of the resource, provided by the client when initially creating the
@ -84,6 +87,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
network:
description:
- The network this subnet belongs to.
@ -94,6 +98,7 @@ options:
to a gcp_compute_network task and then set this network field to "{{ name-of-resource
}}"'
required: true
type: dict
enable_flow_logs:
description:
- Whether to enable flow logging for this subnetwork.
@ -106,6 +111,7 @@ options:
in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange
of the subnetwork. The alias IPs may belong to either primary or secondary ranges.
required: false
type: list
version_added: 2.8
suboptions:
range_name:
@ -114,6 +120,7 @@ options:
an alias IP range to a VM instance. The name must be 1-63 characters long,
and comply with RFC1035. The name must be unique within the subnetwork.
required: true
type: str
ip_cidr_range:
description:
- The range of IP addresses belonging to this subnetwork secondary range.
@ -121,6 +128,7 @@ options:
- Ranges must be unique and non-overlapping with all primary and secondary
IP ranges within a network. Only IPv4 is supported.
required: true
type: str
private_ip_google_access:
description:
- When enabled, VMs in this subnetwork without external IP addresses can access
@ -131,6 +139,7 @@ options:
description:
- URL of the GCP region for this subnetwork.
required: true
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/beta/subnetworks)'

View file

@ -49,6 +49,7 @@ options:
description:
- URL of the GCP region for this subnetwork.
required: true
type: str
extends_documentation_fragment: gcp
'''

View file

@ -48,10 +48,12 @@ options:
- present
- absent
default: present
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -61,6 +63,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
url_map:
description:
- A reference to the UrlMap resource that defines the mapping from URL to the
@ -71,6 +74,7 @@ options:
to a gcp_compute_url_map task and then set this url_map field to "{{ name-of-resource
}}"'
required: true
type: dict
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/targetHttpProxies)'

View file

@ -48,10 +48,12 @@ options:
- present
- absent
default: present
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -61,6 +63,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
quic_override:
description:
- Specifies the QUIC override policy for this resource. This determines whether
@ -70,6 +73,7 @@ options:
field is equivalent to specifying NONE.
- 'Some valid choices include: "NONE", "ENABLE", "DISABLE"'
required: false
type: str
version_added: 2.7
ssl_certificates:
description:
@ -77,6 +81,7 @@ options:
between users and the load balancer. Currently, exactly one SSL certificate
must be specified.
required: true
type: list
ssl_policy:
description:
- A reference to the SslPolicy resource that will be associated with the TargetHttpsProxy
@ -88,6 +93,7 @@ options:
to a gcp_compute_ssl_policy task and then set this ssl_policy field to "{{ name-of-resource
}}"'
required: false
type: dict
version_added: 2.8
url_map:
description:
@ -99,6 +105,7 @@ options:
to a gcp_compute_url_map task and then set this url_map field to "{{ name-of-resource
}}"'
required: true
type: dict
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/targetHttpsProxies)'

View file

@ -47,6 +47,7 @@ options:
- present
- absent
default: present
type: str
backup_pool:
description:
- This field is applicable only when the containing target pool is serving a forwarding
@ -66,10 +67,12 @@ options:
to a gcp_compute_target_pool task and then set this backup_pool field to "{{
name-of-resource }}"'
required: false
type: dict
description:
description:
- An optional description of this resource.
required: false
type: str
failover_ratio:
description:
- This field is applicable only when the containing target pool is serving a forwarding
@ -84,6 +87,7 @@ options:
"force" mode, where traffic will be spread to the healthy instances with the
best effort, or to all instances when no instance is healthy.
required: false
type: str
health_check:
description:
- A reference to a HttpHealthCheck resource.
@ -96,11 +100,13 @@ options:
name-of-resource` to a gcp_compute_http_health_check task and then set this
health_check field to "{{ name-of-resource }}"'
required: false
type: dict
instances:
description:
- A list of virtual machine instances serving this pool.
- They must live in zones contained in the same region as this pool.
required: false
type: list
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -110,6 +116,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
session_affinity:
description:
- 'Session affinity option. Must be one of these values: - NONE: Connections from
@ -120,10 +127,12 @@ options:
will go to the same instance in the pool while that instance remains healthy."
- 'Some valid choices include: "NONE", "CLIENT_IP", "CLIENT_IP_PROTO"'
required: false
type: str
region:
description:
- The region where the target pool resides.
required: true
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/targetPools)'
@ -352,7 +361,7 @@ def return_if_object(module, response, kind, allow_not_found=False):
except getattr(json.decoder, 'JSONDecodeError', ValueError):
module.fail_json(msg="Invalid JSON response with error: %s" % response.text)
result = decode_request(result, module)
result = decode_response(result, module)
if navigate_hash(result, ['error', 'errors']):
module.fail_json(msg=navigate_hash(result, ['error', 'errors']))
@ -363,7 +372,7 @@ def return_if_object(module, response, kind, allow_not_found=False):
def is_different(module, response):
request = resource_to_request(module)
response = response_to_hash(module, response)
request = decode_request(request, module)
request = decode_response(request, module)
# Remove all output-only from response.
response_vals = {}
@ -410,7 +419,7 @@ def wait_for_operation(module, response):
return {}
status = navigate_hash(op_result, ['status'])
wait_done = wait_for_completion(status, op_result, module)
return fetch_resource(module, navigate_hash(wait_done, ['targetLink']), 'compute#targetPool')
return decode_response(fetch_resource(module, navigate_hash(wait_done, ['targetLink']), 'compute#targetPool'), module)
def wait_for_completion(status, op_result, module):
@ -445,7 +454,7 @@ def encode_request(request, module):
# Mask healthChecks into a single element.
# @see encode_request for details
def decode_request(response, module):
def decode_response(response, module):
if response['kind'] != 'compute#targetPool':
return response

View file

@ -49,6 +49,7 @@ options:
description:
- The region where the target pool resides.
required: true
type: str
extends_documentation_fragment: gcp
'''

View file

@ -48,10 +48,12 @@ options:
- present
- absent
default: present
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -61,12 +63,14 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
proxy_header:
description:
- Specifies the type of proxy header to append before sending data to the backend,
either NONE or PROXY_V1. The default is NONE.
- 'Some valid choices include: "NONE", "PROXY_V1"'
required: false
type: str
service:
description:
- A reference to the BackendService resource.
@ -76,12 +80,14 @@ options:
name-of-resource` to a gcp_compute_backend_service task and then set this service
field to "{{ name-of-resource }}"'
required: true
type: dict
ssl_certificates:
description:
- A list of SslCertificate resources that are used to authenticate connections
between users and the load balancer. Currently, exactly one SSL certificate
must be specified.
required: true
type: list
ssl_policy:
description:
- A reference to the SslPolicy resource that will be associated with the TargetSslProxy
@ -93,6 +99,7 @@ options:
to a gcp_compute_ssl_policy task and then set this ssl_policy field to "{{ name-of-resource
}}"'
required: false
type: dict
version_added: 2.8
extends_documentation_fragment: gcp
notes:

View file

@ -48,10 +48,12 @@ options:
- present
- absent
default: present
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -61,12 +63,14 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
proxy_header:
description:
- Specifies the type of proxy header to append before sending data to the backend,
either NONE or PROXY_V1. The default is NONE.
- 'Some valid choices include: "NONE", "PROXY_V1"'
required: false
type: str
service:
description:
- A reference to the BackendService resource.
@ -76,6 +80,7 @@ options:
name-of-resource` to a gcp_compute_backend_service task and then set this service
field to "{{ name-of-resource }}"'
required: true
type: dict
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/targetTcpProxies)'

View file

@ -48,10 +48,12 @@ options:
- present
- absent
default: present
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -61,6 +63,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
network:
description:
- The network this VPN gateway is accepting traffic for.
@ -70,10 +73,12 @@ options:
to a gcp_compute_network task and then set this network field to "{{ name-of-resource
}}"'
required: true
type: dict
region:
description:
- The region this gateway should sit in.
required: true
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/targetVpnGateways)'

View file

@ -49,6 +49,7 @@ options:
description:
- The region this gateway should sit in.
required: true
type: str
extends_documentation_fragment: gcp
'''

View file

@ -679,27 +679,16 @@ lib/ansible/modules/cloud/google/gcp_compute_network.py E337
lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_region_disk.py E337
lib/ansible/modules/cloud/google/gcp_compute_route_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_route.py E337
lib/ansible/modules/cloud/google/gcp_compute_router_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_router.py E337
lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py E337
lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py E337
lib/ansible/modules/cloud/google/gcp_compute_subnetwork_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_subnetwork.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_pool_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_pool.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_tcp_proxy.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py E337
lib/ansible/modules/cloud/google/gcp_compute_url_map_facts.py E337
lib/ansible/modules/cloud/google/gcp_compute_url_map.py E337
lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel_facts.py E337