Bug fixes for GCP modules (#59130)

pull/59267/head
The Magician 5 years ago committed by ansibot
parent 6128d0cd8b
commit 5f222c478d

@ -56,6 +56,7 @@ options:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
ip_address:
description:
- The IP address that this forwarding rule is serving on behalf of.
@ -78,6 +79,7 @@ options:
* projects/project/regions/region/addresses/address * regions/region/addresses/address
* global/addresses/address * address .'
required: false
type: str
ip_protocol:
description:
- The IP protocol to which this rule applies. Valid options are TCP, UDP, ESP,
@ -85,12 +87,14 @@ options:
TCP is valid.
- 'Some valid choices include: "TCP", "UDP", "ESP", "AH", "SCTP", "ICMP"'
required: false
type: str
ip_version:
description:
- The IP Version that will be used by this global forwarding rule.
- Valid options are IPV4 or IPV6.
- 'Some valid choices include: "IPV4", "IPV6"'
required: false
type: str
load_balancing_scheme:
description:
- This signifies what the GlobalForwardingRule will be used for.
@ -101,6 +105,7 @@ options:
- 'Some valid choices include: "INTERNAL_SELF_MANAGED", "EXTERNAL"'
required: false
default: EXTERNAL
type: str
name:
description:
- Name of the resource; provided by the client when the resource is created. The
@ -110,6 +115,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:
- This field is not used for external load balancing.
@ -122,6 +128,7 @@ options:
to a gcp_compute_network task and then set this network field to "{{ name-of-resource
}}"'
required: false
type: dict
port_range:
description:
- This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy,
@ -136,11 +143,13 @@ options:
43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 * TargetVpnGateway:
500, 4500 .'
required: false
type: str
target:
description:
- The URL of the target resource to receive the matched traffic.
- The forwarded traffic must be of a type appropriate to the target object.
required: true
type: str
extends_documentation_fragment: gcp
'''

@ -60,17 +60,20 @@ options:
- How often (in seconds) to send a health check. The default value is 5 seconds.
required: false
default: '5'
type: int
description:
description:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
healthy_threshold:
description:
- A so-far unhealthy instance will be marked healthy after this many consecutive
successes. The default value is 2.
required: false
default: '2'
type: int
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -80,6 +83,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
timeout_sec:
description:
- How long (in seconds) to wait before claiming failure.
@ -87,6 +91,7 @@ options:
value than checkIntervalSec.
required: false
default: '5'
type: int
aliases:
- timeout_seconds
unhealthy_threshold:
@ -95,6 +100,7 @@ options:
failures. The default value is 2.
required: false
default: '2'
type: int
type:
description:
- Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If not
@ -102,10 +108,12 @@ options:
field must be specified, which must match type field.
- 'Some valid choices include: "TCP", "SSL", "HTTP", "HTTPS"'
required: false
type: str
http_health_check:
description:
- A nested object resource.
required: false
type: dict
suboptions:
host:
description:
@ -113,28 +121,33 @@ options:
- If left empty (default value), the public IP on behalf of which this health
check is performed will be used.
required: false
type: str
request_path:
description:
- The request path of the HTTP health check request.
- The default value is /.
required: false
default: "/"
type: str
response:
description:
- The bytes to match against the beginning of the response data. If left empty
(the default value), any response will indicate health. The response data
can only be ASCII.
required: false
type: str
port:
description:
- The TCP port number for the HTTP health check request.
- The default value is 80.
required: false
type: int
port_name:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
required: false
type: str
proxy_header:
description:
- Specifies the type of proxy header to append before sending data to the
@ -142,10 +155,12 @@ options:
- 'Some valid choices include: "NONE", "PROXY_V1"'
required: false
default: NONE
type: str
https_health_check:
description:
- A nested object resource.
required: false
type: dict
suboptions:
host:
description:
@ -153,28 +168,33 @@ options:
- If left empty (default value), the public IP on behalf of which this health
check is performed will be used.
required: false
type: str
request_path:
description:
- The request path of the HTTPS health check request.
- The default value is /.
required: false
default: "/"
type: str
response:
description:
- The bytes to match against the beginning of the response data. If left empty
(the default value), any response will indicate health. The response data
can only be ASCII.
required: false
type: str
port:
description:
- The TCP port number for the HTTPS health check request.
- The default value is 443.
required: false
type: int
port_name:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
required: false
type: str
proxy_header:
description:
- Specifies the type of proxy header to append before sending data to the
@ -182,10 +202,12 @@ options:
- 'Some valid choices include: "NONE", "PROXY_V1"'
required: false
default: NONE
type: str
tcp_health_check:
description:
- A nested object resource.
required: false
type: dict
suboptions:
request:
description:
@ -193,22 +215,26 @@ options:
(default value is empty). If both request and response are empty, the connection
establishment alone will indicate health. The request data can only be ASCII.
required: false
type: str
response:
description:
- The bytes to match against the beginning of the response data. If left empty
(the default value), any response will indicate health. The response data
can only be ASCII.
required: false
type: str
port:
description:
- The TCP port number for the TCP health check request.
- The default value is 443.
required: false
type: int
port_name:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
required: false
type: str
proxy_header:
description:
- Specifies the type of proxy header to append before sending data to the
@ -216,10 +242,12 @@ options:
- 'Some valid choices include: "NONE", "PROXY_V1"'
required: false
default: NONE
type: str
ssl_health_check:
description:
- A nested object resource.
required: false
type: dict
suboptions:
request:
description:
@ -227,22 +255,26 @@ options:
(default value is empty). If both request and response are empty, the connection
establishment alone will indicate health. The request data can only be ASCII.
required: false
type: str
response:
description:
- The bytes to match against the beginning of the response data. If left empty
(the default value), any response will indicate health. The response data
can only be ASCII.
required: false
type: str
port:
description:
- The TCP port number for the SSL health check request.
- The default value is 443.
required: false
type: int
port_name:
description:
- Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name
are defined, port takes precedence.
required: false
type: str
proxy_header:
description:
- Specifies the type of proxy header to append before sending data to the
@ -250,6 +282,7 @@ options:
- 'Some valid choices include: "NONE", "PROXY_V1"'
required: false
default: NONE
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/healthChecks)'

@ -53,6 +53,7 @@ options:
- How often (in seconds) to send a health check. The default value is 5 seconds.
required: false
default: '5'
type: int
aliases:
- check_interval_seconds
description:
@ -60,17 +61,20 @@ options:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
healthy_threshold:
description:
- A so-far unhealthy instance will be marked healthy after this many consecutive
successes. The default value is 2.
required: false
type: int
host:
description:
- The value of the host header in the HTTP health check request. If left empty
(default value), the public IP on behalf of which this health check is performed
will be used.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -80,22 +84,26 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
port:
description:
- The TCP port number for the HTTP health check request.
- The default value is 80.
required: false
type: int
request_path:
description:
- The request path of the HTTP health check request.
- The default value is /.
required: false
type: str
timeout_sec:
description:
- How long (in seconds) to wait before claiming failure.
- The default value is 5 seconds. It is invalid for timeoutSec to have greater
value than checkIntervalSec.
required: false
type: int
aliases:
- timeout_seconds
unhealthy_threshold:
@ -103,6 +111,7 @@ options:
- A so-far healthy instance will be marked unhealthy after this many consecutive
failures. The default value is 2.
required: false
type: int
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks)'

@ -52,22 +52,26 @@ options:
description:
- How often (in seconds) to send a health check. The default value is 5 seconds.
required: false
type: int
description:
description:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
healthy_threshold:
description:
- A so-far unhealthy instance will be marked healthy after this many consecutive
successes. The default value is 2.
required: false
type: int
host:
description:
- The value of the host header in the HTTPS health check request. If left empty
(default value), the public IP on behalf of which this health check is performed
will be used.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -77,22 +81,26 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
port:
description:
- The TCP port number for the HTTPS health check request.
- The default value is 80.
required: false
type: int
request_path:
description:
- The request path of the HTTPS health check request.
- The default value is /.
required: false
type: str
timeout_sec:
description:
- How long (in seconds) to wait before claiming failure.
- The default value is 5 seconds. It is invalid for timeoutSec to have greater
value than checkIntervalSec.
required: false
type: int
aliases:
- timeout_seconds
unhealthy_threshold:
@ -100,6 +108,7 @@ options:
- A so-far healthy instance will be marked unhealthy after this many consecutive
failures. The default value is 2.
required: false
type: int
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks)'

@ -62,10 +62,12 @@ options:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
disk_size_gb:
description:
- Size of the image when restored onto a persistent disk (in GB).
required: false
type: int
family:
description:
- The name of the image family to which this image belongs. You can create disks
@ -73,6 +75,7 @@ options:
always returns its latest image that is not deprecated. The name of the image
family must comply with RFC1035.
required: false
type: str
guest_os_features:
description:
- A list of features to enable on the guest OS. Applicable for bootable images
@ -84,6 +87,7 @@ options:
WINDOWS, to indicate that this is a Windows image.
- This value is purely informational and does not enable or disable any features.
required: false
type: list
suboptions:
type:
description:
@ -93,27 +97,32 @@ options:
purely informational and does not enable or disable any features.
- 'Some valid choices include: "VIRTIO_SCSI_MULTIQUEUE"'
required: false
type: str
image_encryption_key:
description:
- Encrypts the image using a customer-supplied encryption key.
- After you encrypt an image with a customer-supplied key, you must provide the
same key if you use the image later (e.g. to create a disk from the image) .
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648
base64 to either encrypt or decrypt this resource.
required: false
type: str
labels:
description:
- Labels to apply to this Image.
required: false
type: dict
version_added: 2.8
licenses:
description:
- Any applicable license URI.
required: false
type: list
name:
description:
- Name of the resource; provided by the client when the resource is created. The
@ -123,10 +132,12 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
raw_disk:
description:
- The parameters of the raw disk image.
required: false
type: dict
suboptions:
container_type:
description:
@ -135,16 +146,19 @@ options:
format. Provided by the client when the disk image is created.
- 'Some valid choices include: "TAR"'
required: false
type: str
sha1_checksum:
description:
- An optional SHA1 checksum of the disk image before unpackaging.
- This is provided by the client when the disk image is created.
required: false
type: str
source:
description:
- The full Google Cloud Storage URL where disk storage is stored You must
provide either this property or the sourceDisk property but not both.
required: true
type: str
source_disk:
description:
- The source disk to create this image based on.
@ -156,29 +170,34 @@ options:
to a gcp_compute_disk task and then set this source_disk field to "{{ name-of-resource
}}"'
required: false
type: dict
source_disk_encryption_key:
description:
- The customer-supplied encryption key of the source disk. Required if the source
disk is protected by a customer-supplied encryption key.
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648
base64 to either encrypt or decrypt this resource.
required: false
type: str
source_disk_id:
description:
- The ID value of the disk used to create this image. This value may be used to
determine whether the image was taken from the current or a previous instance
of a given disk name.
required: false
type: str
source_type:
description:
- The type of the image used to create this disk. The default and only value is
RAW .
- 'Some valid choices include: "RAW"'
required: false
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/images)'

@ -61,6 +61,7 @@ options:
- An array of disks that are associated with the instances that are created from
this template.
required: false
type: list
suboptions:
auto_delete:
description:
@ -83,21 +84,25 @@ options:
the instance. This name can be used to reference the device for mounting,
resizing, and so on, from within the instance.
required: false
type: str
disk_encryption_key:
description:
- Encrypts or decrypts a disk using a customer-supplied encryption key.
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC
4648 base64 to either encrypt or decrypt this resource.
required: false
type: str
rsa_encrypted_key:
description:
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
encryption key to either encrypt or decrypt this resource.
required: false
type: str
index:
description:
- Assigns a zero-based index to this disk, where 0 is reserved for the boot
@ -105,28 +110,33 @@ options:
disk would have a unique index number. If not specified, the server will
choose an appropriate value.
required: false
type: int
initialize_params:
description:
- Specifies the parameters for a new disk that will be created alongside the
new instance. Use initialization parameters to create boot disks or local
SSDs attached to the new instance.
required: false
type: dict
suboptions:
disk_name:
description:
- Specifies the disk name. If not specified, the default is to use the
name of the instance.
required: false
type: str
disk_size_gb:
description:
- Specifies the size of the disk in base-2 GB.
required: false
type: int
disk_type:
description:
- Reference to a disk type.
- Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard.
required: false
type: str
source_image:
description:
- The source image to create this disk. When creating a new instance,
@ -134,6 +144,7 @@ options:
create a disk with one of the public operating system images, specify
the image by its family name.
required: false
type: str
aliases:
- image
- image_family
@ -145,12 +156,14 @@ options:
you cannot create disks for instances in a managed instance group if
the source images are encrypted with your own keys.
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded in
RFC 4648 base64 to either encrypt or decrypt this resource.
required: false
type: str
interface:
description:
- Specifies the disk interface to use for attaching this disk, which is either
@ -159,12 +172,14 @@ options:
to attach a persistent disk in any other format than SCSI.
- 'Some valid choices include: "SCSI", "NVME"'
required: false
type: str
mode:
description:
- The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If
not specified, the default is to attach the disk in READ_WRITE mode.
- 'Some valid choices include: "READ_WRITE", "READ_ONLY"'
required: false
type: str
source:
description:
- Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
@ -177,44 +192,53 @@ options:
name-of-resource` to a gcp_compute_disk task and then set this source field
to "{{ name-of-resource }}"'
required: false
type: dict
type:
description:
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified,
the default is PERSISTENT.
- 'Some valid choices include: "SCRATCH", "PERSISTENT"'
required: false
type: str
guest_accelerators:
description:
- List of the type and count of accelerator cards attached to the instance .
required: false
type: list
suboptions:
accelerator_count:
description:
- The number of the guest accelerator cards exposed to this instance.
required: false
type: int
accelerator_type:
description:
- Full or partial URL of the accelerator type resource to expose to this instance.
required: false
type: str
labels:
description:
- Labels to apply to this instance. A list of key->value pairs.
required: false
type: dict
version_added: 2.9
metadata:
description:
- The metadata key/value pairs to assign to instances that are created from this
template. These pairs can consist of custom metadata or predefined keys.
required: false
type: dict
machine_type:
description:
- A reference to a machine type which defines VM kind.
required: false
type: str
min_cpu_platform:
description:
- Specifies a minimum CPU platform for the VM instance. Applicable values are
the friendly names of CPU platforms .
required: false
type: str
name:
description:
- The name of the resource, provided by the client when initially creating the
@ -224,12 +248,14 @@ options:
letter, and all following characters must be a dash, lowercase letter, or digit,
except the last character, which cannot be a dash.
required: false
type: str
network_interfaces:
description:
- An array of configurations for this interface. This specifies how this interface
is configured to interact with other network services, such as connecting to
the internet. Only one network interface is supported per instance.
required: false
type: list
suboptions:
access_configs:
description:
@ -237,6 +263,7 @@ options:
config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified,
then this instance will have no external internet access.
required: false
type: list
suboptions:
name:
description:
@ -244,6 +271,7 @@ options:
is External NAT but you can use any arbitrary string you would like.
For example, My external IP or Network Access.
required: true
type: str
nat_ip:
description:
- Reference to an address.
@ -258,16 +286,19 @@ options:
name-of-resource` to a gcp_compute_address task and then set this nat_ip
field to "{{ name-of-resource }}"'
required: false
type: dict
type:
description:
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
- 'Some valid choices include: "ONE_TO_ONE_NAT"'
required: true
type: str
alias_ip_ranges:
description:
- An array of alias IP ranges for this network interface. Can only be specified
for network interfaces on subnet-mode networks.
required: false
type: list
suboptions:
ip_cidr_range:
description:
@ -277,12 +308,14 @@ options:
This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g.
/24) or a CIDR format string (e.g. 10.1.2.0/24).
required: false
type: str
subnetwork_range_name:
description:
- Optional subnetwork secondary range name specifying the secondary range
from which to allocate the IP CIDR range for this alias IP range. If
left unspecified, the primary range of the subnetwork will be used.
required: false
type: str
network:
description:
- Specifies the title of an existing network. When creating an instance, if
@ -295,12 +328,14 @@ options:
name-of-resource` to a gcp_compute_network task and then set this network
field to "{{ name-of-resource }}"'
required: false
type: dict
network_ip:
description:
- An IPv4 internal network address to assign to the instance for this network
interface. If not specified by the user, an unused internal IP is assigned
by the system.
required: false
type: str
subnetwork:
description:
- Reference to a VPC network.
@ -313,10 +348,12 @@ options:
name-of-resource` to a gcp_compute_subnetwork task and then set this subnetwork
field to "{{ name-of-resource }}"'
required: false
type: dict
scheduling:
description:
- Sets the scheduling options for this instance.
required: false
type: dict
suboptions:
automatic_restart:
description:
@ -333,6 +370,7 @@ options:
and only possible behavior is TERMINATE.
- For more information, see Setting Instance Scheduling Options.
required: false
type: str
preemptible:
description:
- Defines whether the instance is preemptible. This can only be set during
@ -345,15 +383,18 @@ options:
- A list of service accounts, with their specified scopes, authorized for this
instance. Only one service account per VM instance is supported.
required: false
type: list
suboptions:
email:
description:
- Email address of the service account.
required: false
type: str
scopes:
description:
- The list of scopes to be made available for this service account.
required: false
type: list
status:
description:
- 'The status of the instance. One of the following values: PROVISIONING, STAGING,
@ -363,6 +404,7 @@ options:
- 'Some valid choices include: "PROVISIONING", "STAGING", "RUNNING", "STOPPING",
"SUSPENDING", "SUSPENDED", "TERMINATED"'
required: false
type: str
version_added: 2.8
tags:
description:
@ -371,6 +413,7 @@ options:
creation. The tags can be later modified by the setTags method. Each tag within
the list must comply with RFC1035.
required: false
type: dict
suboptions:
fingerprint:
description:
@ -380,15 +423,18 @@ options:
every request to modify or update metadata. You must always provide an up-to-date
fingerprint hash in order to update or change metadata.
required: false
type: str
items:
description:
- An array of tags. Each tag must be 1-63 characters long, and comply with
RFC1035.
required: false
type: list
zone:
description:
- A reference to the zone where the machine resides.
required: true
type: str
extends_documentation_fragment: gcp
'''
@ -1139,7 +1185,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#instance')
return decode_response(fetch_resource(module, navigate_hash(wait_done, ['targetLink']), 'compute#instance'), module)
def wait_for_completion(status, op_result, module):

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

@ -55,11 +55,13 @@ options:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
name:
description:
- The name of the instance group.
- The name must be 1-63 characters long, and comply with RFC1035.
required: false
type: str
named_ports:
description:
- Assigns a name to a port number.
@ -69,16 +71,19 @@ options:
- 'For example: [{name: "http", port: 80},{name: "http", port: 8080}] Named ports
apply to all instances in this instance group.'
required: false
type: list
suboptions:
name:
description:
- The name for this named port.
- The name must be 1-63 characters long, and comply with RFC1035.
required: false
type: str
port:
description:
- The port number, which can be a value between 1 and 65535.
required: false
type: int
network:
description:
- The network to which all instances in the instance group belong.
@ -88,10 +93,12 @@ options:
to a gcp_compute_network task and then set this network field to "{{ name-of-resource
}}"'
required: false
type: dict
region:
description:
- The region where the instance group is located (for regional resources).
required: false
type: str
subnetwork:
description:
- The subnetwork to which all instances in the instance group belong.
@ -101,10 +108,12 @@ options:
to a gcp_compute_subnetwork task and then set this subnetwork field to "{{ name-of-resource
}}"'
required: false
type: dict
zone:
description:
- A reference to the zone where the instance group resides.
required: true
type: str
instances:
description:
- The list of instances associated with this InstanceGroup.
@ -113,6 +122,7 @@ options:
not be deleted.
- Only the full identifier of the instance will be returned.
required: false
type: list
version_added: 2.8
extends_documentation_fragment: gcp
'''

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

@ -59,11 +59,13 @@ options:
four-character string to the base instance name.
- The base instance name must comply with RFC1035.
required: true
type: str
description:
description:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
instance_template:
description:
- The instance template that is specified for this managed instance group. The
@ -75,42 +77,50 @@ options:
name-of-resource` to a gcp_compute_instance_template task and then set this
instance_template field to "{{ name-of-resource }}"'
required: true
type: dict
name:
description:
- The name of the managed instance group. The name must be 1-63 characters long,
and comply with RFC1035.
required: true
type: str
named_ports:
description:
- Named ports configured for the Instance Groups complementary to this Instance
Group Manager.
required: false
type: list
suboptions:
name:
description:
- The name for this named port. The name must be 1-63 characters long, and
comply with RFC1035.
required: false
type: str
port:
description:
- The port number, which can be a value between 1 and 65535.
required: false
type: int
target_pools:
description:
- TargetPool resources to which instances in the instanceGroup field are added.
The target pools automatically apply to all of the instances in the managed
instance group.
required: false
type: list
target_size:
description:
- The target number of running instances for this managed instance group. Deleting
or abandoning instances reduces this number. Resizing the group changes this
number.
required: false
type: int
zone:
description:
- The zone the managed instance group resides.
required: true
type: str
extends_documentation_fragment: gcp
'''

@ -49,6 +49,7 @@ options:
description:
- The zone the managed instance group resides.
required: true
type: str
extends_documentation_fragment: gcp
'''

@ -58,14 +58,17 @@ options:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
name:
description:
- Name of the resource. The name is 1-63 characters long and complies with RFC1035.
required: true
type: str
properties:
description:
- The instance properties for this instance template.
required: false
type: dict
suboptions:
can_ip_forward:
description:
@ -81,11 +84,13 @@ options:
- An optional text description for the instances that are created from this
instance template.
required: false
type: str
disks:
description:
- An array of disks that are associated with the instances that are created
from this template.
required: false
type: list
suboptions:
auto_delete:
description:
@ -108,21 +113,25 @@ options:
within the instance. This name can be used to reference the device for
mounting, resizing, and so on, from within the instance.
required: false
type: str
disk_encryption_key:
description:
- Encrypts or decrypts a disk using a customer-supplied encryption key.
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded in
RFC 4648 base64 to either encrypt or decrypt this resource.
required: false
type: str
rsa_encrypted_key:
description:
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
encryption key to either encrypt or decrypt this resource.
required: false
type: str
index:
description:
- Assigns a zero-based index to this disk, where 0 is reserved for the
@ -130,28 +139,33 @@ options:
each disk would have a unique index number. If not specified, the server
will choose an appropriate value.
required: false
type: int
initialize_params:
description:
- Specifies the parameters for a new disk that will be created alongside
the new instance. Use initialization parameters to create boot disks
or local SSDs attached to the new instance.
required: false
type: dict
suboptions:
disk_name:
description:
- Specifies the disk name. If not specified, the default is to use
the name of the instance.
required: false
type: str
disk_size_gb:
description:
- Specifies the size of the disk in base-2 GB.
required: false
type: int
disk_type:
description:
- Reference to a disk type.
- Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard.
required: false
type: str
source_image:
description:
- The source image to create this disk. When creating a new instance,
@ -159,6 +173,7 @@ options:
To create a disk with one of the public operating system images,
specify the image by its family name.
required: false
type: str
source_image_encryption_key:
description:
- The customer-supplied encryption key of the source image. Required
@ -168,12 +183,14 @@ options:
so you cannot create disks for instances in a managed instance group
if the source images are encrypted with your own keys.
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded
in RFC 4648 base64 to either encrypt or decrypt this resource.
required: false
type: str
interface:
description:
- Specifies the disk interface to use for attaching this disk, which is
@ -182,12 +199,14 @@ options:
attempt to attach a persistent disk in any other format than SCSI.
- 'Some valid choices include: "SCSI", "NVME"'
required: false
type: str
mode:
description:
- The mode in which to attach this disk, either READ_WRITE or READ_ONLY.
If not specified, the default is to attach the disk in READ_WRITE mode.
- 'Some valid choices include: "READ_WRITE", "READ_ONLY"'
required: false
type: str
source:
description:
- Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
@ -202,48 +221,57 @@ options:
name-of-resource` to a gcp_compute_disk task and then set this source
field to "{{ name-of-resource }}"'
required: false
type: dict
type:
description:
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not
specified, the default is PERSISTENT.
- 'Some valid choices include: "SCRATCH", "PERSISTENT"'
required: false
type: str
machine_type:
description:
- The machine type to use in the VM instance template.
required: true
type: str
min_cpu_platform:
description:
- Specifies a minimum CPU platform for the VM instance. Applicable values
are the friendly names of CPU platforms .
required: false
type: str
metadata:
description:
- The metadata key/value pairs to assign to instances that are created from
this template. These pairs can consist of custom metadata or predefined
keys.
required: false
type: dict
guest_accelerators:
description:
- List of the type and count of accelerator cards attached to the instance
.
required: false
type: list
suboptions:
accelerator_count:
description:
- The number of the guest accelerator cards exposed to this instance.
required: false
type: int
accelerator_type:
description:
- Full or partial URL of the accelerator type resource to expose to this
instance.
required: false
type: str
network_interfaces:
description:
- An array of configurations for this interface. This specifies how this interface
is configured to interact with other network services, such as connecting
to the internet. Only one network interface is supported per instance.
required: false
type: list
suboptions:
access_configs:
description:
@ -251,6 +279,7 @@ options:
config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs
specified, then this instance will have no external internet access.
required: false
type: list
suboptions:
name:
description:
@ -258,6 +287,7 @@ options:
name is External NAT but you can use any arbitrary string you would
like. For example, My external IP or Network Access.
required: true
type: str
nat_ip:
description:
- Reference to an address.
@ -272,16 +302,19 @@ options:
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: dict
type:
description:
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
- 'Some valid choices include: "ONE_TO_ONE_NAT"'
required: true
type: str
alias_ip_ranges:
description:
- An array of alias IP ranges for this network interface. Can only be
specified for network interfaces on subnet-mode networks.
required: false
type: list
suboptions:
ip_cidr_range:
description:
@ -291,6 +324,7 @@ options:
interfaces. This range may be a single IP address (e.g. 10.2.3.4),
a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
required: false
type: str
subnetwork_range_name:
description:
- Optional subnetwork secondary range name specifying the secondary
@ -298,6 +332,7 @@ options:
range. If left unspecified, the primary range of the subnetwork
will be used.
required: false
type: str
network:
description:
- Specifies the title of an existing network. When creating an instance,
@ -310,12 +345,14 @@ options:
name-of-resource` to a gcp_compute_network task and then set this network
field to "{{ name-of-resource }}"'
required: false
type: dict
network_ip:
description:
- An IPv4 internal network address to assign to the instance for this
network interface. If not specified by the user, an unused internal
IP is assigned by the system.
required: false
type: str
subnetwork:
description:
- Reference to a VPC network.
@ -328,10 +365,12 @@ options:
can add `register: name-of-resource` to a gcp_compute_subnetwork task
and then set this subnetwork field to "{{ name-of-resource }}"'
required: false
type: dict
scheduling:
description:
- Sets the scheduling options for this instance.
required: false
type: dict
suboptions:
automatic_restart:
description:
@ -348,6 +387,7 @@ options:
and only possible behavior is TERMINATE.
- For more information, see Setting Instance Scheduling Options.
required: false
type: str
preemptible:
description:
- Defines whether the instance is preemptible. This can only be set during
@ -360,15 +400,18 @@ options:
- A list of service accounts, with their specified scopes, authorized for
this instance. Only one service account per VM instance is supported.
required: false
type: list
suboptions:
email:
description:
- Email address of the service account.
required: false
type: str
scopes:
description:
- The list of scopes to be made available for this service account.
required: false
type: list
tags:
description:
- A list of tags to apply to this instance. Tags are used to identify valid
@ -376,6 +419,7 @@ options:
during instance creation. The tags can be later modified by the setTags
method. Each tag within the list must comply with RFC1035.
required: false
type: dict
suboptions:
fingerprint:
description:
@ -385,11 +429,13 @@ options:
after every request to modify or update metadata. You must always provide
an up-to-date fingerprint hash in order to update or change metadata.
required: false
type: str
items:
description:
- An array of tags. Each tag must be 1-63 characters long, and comply
with RFC1035.
required: false
type: list
extends_documentation_fragment: gcp
'''
@ -1058,7 +1104,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#instanceTemplate')
return decode_response(fetch_resource(module, navigate_hash(wait_done, ['targetLink']), 'compute#instanceTemplate'), module)
def wait_for_completion(status, op_result, module):

@ -54,10 +54,12 @@ options:
traverse through. Required if type is DEDICATED, must not be set if type is
PARTNER.
required: false
type: str
description:
description:
- An optional description of this resource.
required: false
type: str
edge_availability_domain:
description:
- Desired availability domain for the attachment. Only available for type PARTNER,
@ -67,11 +69,13 @@ options:
circuit will lie in the specified domain. If not specified, the value will default
to AVAILABILITY_DOMAIN_ANY.
required: false
type: str
type:
description:
- The type of InterconnectAttachment you wish to create. Defaults to DEDICATED.
- 'Some valid choices include: "DEDICATED", "PARTNER", "PARTNER_PROVIDER"'
required: false
type: str
router:
description:
- URL of the cloud router to be used for dynamic routing. This router must be
@ -84,6 +88,7 @@ options:
to a gcp_compute_router task and then set this router field to "{{ name-of-resource
}}"'
required: true
type: dict
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -93,6 +98,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
candidate_subnets:
description:
- Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress
@ -103,15 +109,18 @@ options:
/29s are in use on Google's edge. If not supplied, Google will randomly select
an unused /29 from all of link-local space.
required: false
type: list
vlan_tag8021q:
description:
- The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When using
PARTNER type this will be managed upstream.
required: false
type: int
region:
description:
- Region where the regional interconnect attachment resides.
required: true
type: str
extends_documentation_fragment: gcp
'''

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

@ -52,6 +52,7 @@ options:
- An optional description of this resource. The resource must be recreated to
modify this field.
required: false
type: str
ipv4_range:
description:
- If this field is specified, a deprecated legacy network is created.
@ -62,6 +63,7 @@ options:
- 'This range is a CIDR specification, for example: `192.168.0.0/16`.'
- The resource must be recreated to modify this field.
required: false
type: str
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -71,6 +73,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
auto_create_subnetworks:
description:
- When set to `true`, the network is created in "auto subnet mode" and it will
@ -85,6 +88,7 @@ options:
- The network-level routing configuration for this network. Used by Cloud Router
to determine what type of network-wide routing behavior to enforce.
required: false
type: dict
version_added: 2.8
suboptions:
routing_mode:
@ -96,6 +100,7 @@ options:
regions.
- 'Some valid choices include: "REGIONAL", "GLOBAL"'
required: true
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/networks)'

@ -62,14 +62,17 @@ options:
- An optional description of this resource. Provide this property when you create
the resource.
required: false
type: str
labels:
description:
- Labels to apply to this disk. A list of key->value pairs.
required: false
type: dict
licenses:
description:
- Any applicable publicly visible licenses.
required: false
type: list
name:
description:
- Name of the resource. Provided by the client when the resource is created. The
@ -79,6 +82,7 @@ options:
characters must be a dash, lowercase letter, or digit, except the last character,
which cannot be a dash.
required: true
type: str
size_gb:
description:
- Size of the persistent disk, specified in GB. You can specify this field when
@ -88,6 +92,7 @@ options:
of sizeGb must not be less than the size of the sourceImage or the size of the
snapshot.
required: false
type: int
physical_block_size_bytes:
description:
- Physical block size of the persistent disk, in bytes. If not present in a request,
@ -96,19 +101,23 @@ options:
- If an unsupported value is requested, the error message will list the supported
values for the caller's project.
required: false
type: int
replica_zones:
description:
- URLs of the zones where the disk should be replicated to.
required: true
type: list
type:
description:
- URL of the disk type resource describing which disk type to use to create the
disk. Provide this when creating the disk.
required: false
type: str
region:
description:
- A reference to the region where the disk resides.
required: true
type: str
disk_encryption_key:
description:
- Encrypts the disk using a customer-supplied encryption key.
@ -120,12 +129,14 @@ options:
will be encrypted using an automatically generated key and you do not need to
provide a key to use the disk later.
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648
base64 to either encrypt or decrypt this resource.
required: false
type: str
source_snapshot:
description:
- The source snapshot used to create this disk. You can provide this as a partial
@ -136,17 +147,20 @@ options:
to a gcp_compute_snapshot task and then set this source_snapshot field to "{{
name-of-resource }}"'
required: false
type: dict
source_snapshot_encryption_key:
description:
- The customer-supplied encryption key of the source snapshot. Required if the
source snapshot is protected by a customer-supplied encryption key.
required: false
type: dict
suboptions:
raw_key:
description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648
base64 to either encrypt or decrypt this resource.
required: false
type: str
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/beta/regionDisks)'

Loading…
Cancel
Save