mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-23 06:21:43 -07:00
Bug fixes for GCP modules (#56689)
This commit is contained in:
parent
0ff62fd5c4
commit
713ac29054
18 changed files with 91 additions and 99 deletions
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
|
|
|
@ -91,9 +91,8 @@ options:
|
||||||
For newer Windows images, the server might also populate this property with
|
For newer Windows images, the server might also populate this property with
|
||||||
the value WINDOWS to indicate that this is a Windows image. This value is
|
the value WINDOWS to indicate that this is a Windows image. This value is
|
||||||
purely informational and does not enable or disable any features.
|
purely informational and does not enable or disable any features.
|
||||||
|
- 'Some valid choices include: "VIRTIO_SCSI_MULTIQUEUE"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- VIRTIO_SCSI_MULTIQUEUE
|
|
||||||
image_encryption_key:
|
image_encryption_key:
|
||||||
description:
|
description:
|
||||||
- Encrypts the image using a customer-supplied encryption key.
|
- Encrypts the image using a customer-supplied encryption key.
|
||||||
|
@ -134,9 +133,8 @@ options:
|
||||||
- The format used to encode and transmit the block device, which should be
|
- The format used to encode and transmit the block device, which should be
|
||||||
TAR. This is just a container and transmission format and not a runtime
|
TAR. This is just a container and transmission format and not a runtime
|
||||||
format. Provided by the client when the disk image is created.
|
format. Provided by the client when the disk image is created.
|
||||||
|
- 'Some valid choices include: "TAR"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- TAR
|
|
||||||
sha1_checksum:
|
sha1_checksum:
|
||||||
description:
|
description:
|
||||||
- An optional SHA1 checksum of the disk image before unpackaging.
|
- An optional SHA1 checksum of the disk image before unpackaging.
|
||||||
|
@ -179,9 +177,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- The type of the image used to create this disk. The default and only value is
|
- The type of the image used to create this disk. The default and only value is
|
||||||
RAW .
|
RAW .
|
||||||
|
- 'Some valid choices include: "RAW"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- RAW
|
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
notes:
|
notes:
|
||||||
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/images)'
|
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/images)'
|
||||||
|
@ -443,19 +440,16 @@ def main():
|
||||||
description=dict(type='str'),
|
description=dict(type='str'),
|
||||||
disk_size_gb=dict(type='int'),
|
disk_size_gb=dict(type='int'),
|
||||||
family=dict(type='str'),
|
family=dict(type='str'),
|
||||||
guest_os_features=dict(type='list', elements='dict', options=dict(type=dict(type='str', choices=['VIRTIO_SCSI_MULTIQUEUE']))),
|
guest_os_features=dict(type='list', elements='dict', options=dict(type=dict(type='str'))),
|
||||||
image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
||||||
labels=dict(type='dict'),
|
labels=dict(type='dict'),
|
||||||
licenses=dict(type='list', elements='str'),
|
licenses=dict(type='list', elements='str'),
|
||||||
name=dict(required=True, type='str'),
|
name=dict(required=True, type='str'),
|
||||||
raw_disk=dict(
|
raw_disk=dict(type='dict', options=dict(container_type=dict(type='str'), sha1_checksum=dict(type='str'), source=dict(required=True, type='str'))),
|
||||||
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=dict(type='dict'),
|
||||||
source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
||||||
source_disk_id=dict(type='str'),
|
source_disk_id=dict(type='str'),
|
||||||
source_type=dict(type='str', choices=['RAW']),
|
source_type=dict(type='str'),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
|
|
|
@ -157,18 +157,14 @@ options:
|
||||||
SCSI or NVME. The default is SCSI.
|
SCSI or NVME. The default is SCSI.
|
||||||
- Persistent disks must always use SCSI and the request will fail if you attempt
|
- Persistent disks must always use SCSI and the request will fail if you attempt
|
||||||
to attach a persistent disk in any other format than SCSI.
|
to attach a persistent disk in any other format than SCSI.
|
||||||
|
- 'Some valid choices include: "SCSI", "NVME"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- SCSI
|
|
||||||
- NVME
|
|
||||||
mode:
|
mode:
|
||||||
description:
|
description:
|
||||||
- The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If
|
- 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.
|
not specified, the default is to attach the disk in READ_WRITE mode.
|
||||||
|
- 'Some valid choices include: "READ_WRITE", "READ_ONLY"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- READ_WRITE
|
|
||||||
- READ_ONLY
|
|
||||||
source:
|
source:
|
||||||
description:
|
description:
|
||||||
- Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
|
- Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
|
||||||
|
@ -185,10 +181,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified,
|
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified,
|
||||||
the default is PERSISTENT.
|
the default is PERSISTENT.
|
||||||
|
- 'Some valid choices include: "SCRATCH", "PERSISTENT"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- SCRATCH
|
|
||||||
- PERSISTENT
|
|
||||||
guest_accelerators:
|
guest_accelerators:
|
||||||
description:
|
description:
|
||||||
- List of the type and count of accelerator cards attached to the instance .
|
- List of the type and count of accelerator cards attached to the instance .
|
||||||
|
@ -202,14 +196,11 @@ options:
|
||||||
description:
|
description:
|
||||||
- Full or partial URL of the accelerator type resource to expose to this instance.
|
- Full or partial URL of the accelerator type resource to expose to this instance.
|
||||||
required: false
|
required: false
|
||||||
label_fingerprint:
|
labels:
|
||||||
description:
|
description:
|
||||||
- A fingerprint for this request, which is essentially a hash of the metadata's
|
- Labels to apply to this instance. A list of key->value pairs.
|
||||||
contents and used for optimistic locking. The fingerprint is initially generated
|
|
||||||
by Compute Engine and changes 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
|
required: false
|
||||||
|
version_added: 2.9
|
||||||
metadata:
|
metadata:
|
||||||
description:
|
description:
|
||||||
- The metadata key/value pairs to assign to instances that are created from this
|
- The metadata key/value pairs to assign to instances that are created from this
|
||||||
|
@ -270,9 +261,8 @@ options:
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
|
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
|
||||||
|
- 'Some valid choices include: "ONE_TO_ONE_NAT"'
|
||||||
required: true
|
required: true
|
||||||
choices:
|
|
||||||
- ONE_TO_ONE_NAT
|
|
||||||
alias_ip_ranges:
|
alias_ip_ranges:
|
||||||
description:
|
description:
|
||||||
- An array of alias IP ranges for this network interface. Can only be specified
|
- An array of alias IP ranges for this network interface. Can only be specified
|
||||||
|
@ -370,16 +360,10 @@ options:
|
||||||
RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.'
|
RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.'
|
||||||
- As a user, use RUNNING to keep a machine "on" and TERMINATED to turn a machine
|
- As a user, use RUNNING to keep a machine "on" and TERMINATED to turn a machine
|
||||||
off .
|
off .
|
||||||
|
- 'Some valid choices include: "PROVISIONING", "STAGING", "RUNNING", "STOPPING",
|
||||||
|
"SUSPENDING", "SUSPENDED", "TERMINATED"'
|
||||||
required: false
|
required: false
|
||||||
version_added: 2.8
|
version_added: 2.8
|
||||||
choices:
|
|
||||||
- PROVISIONING
|
|
||||||
- STAGING
|
|
||||||
- RUNNING
|
|
||||||
- STOPPING
|
|
||||||
- SUSPENDING
|
|
||||||
- SUSPENDED
|
|
||||||
- TERMINATED
|
|
||||||
tags:
|
tags:
|
||||||
description:
|
description:
|
||||||
- A list of tags to apply to this instance. Tags are used to identify valid sources
|
- A list of tags to apply to this instance. Tags are used to identify valid sources
|
||||||
|
@ -451,6 +435,8 @@ EXAMPLES = '''
|
||||||
metadata:
|
metadata:
|
||||||
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
||||||
cost-center: '12345'
|
cost-center: '12345'
|
||||||
|
labels:
|
||||||
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
access_configs:
|
access_configs:
|
||||||
|
@ -649,13 +635,15 @@ id:
|
||||||
type: int
|
type: int
|
||||||
labelFingerprint:
|
labelFingerprint:
|
||||||
description:
|
description:
|
||||||
- A fingerprint for this request, which is essentially a hash of the metadata's
|
- The fingerprint used for optimistic locking of this resource. Used internally
|
||||||
contents and used for optimistic locking. The fingerprint is initially generated
|
during updates.
|
||||||
by Compute Engine and changes 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.
|
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
|
labels:
|
||||||
|
description:
|
||||||
|
- Labels to apply to this instance. A list of key->value pairs.
|
||||||
|
returned: success
|
||||||
|
type: dict
|
||||||
metadata:
|
metadata:
|
||||||
description:
|
description:
|
||||||
- The metadata key/value pairs to assign to instances that are created from this
|
- The metadata key/value pairs to assign to instances that are created from this
|
||||||
|
@ -901,14 +889,14 @@ def main():
|
||||||
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
interface=dict(type='str', choices=['SCSI', 'NVME']),
|
interface=dict(type='str'),
|
||||||
mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']),
|
mode=dict(type='str'),
|
||||||
source=dict(type='dict'),
|
source=dict(type='dict'),
|
||||||
type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']),
|
type=dict(type='str'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
guest_accelerators=dict(type='list', elements='dict', options=dict(accelerator_count=dict(type='int'), accelerator_type=dict(type='str'))),
|
guest_accelerators=dict(type='list', elements='dict', options=dict(accelerator_count=dict(type='int'), accelerator_type=dict(type='str'))),
|
||||||
label_fingerprint=dict(type='str'),
|
labels=dict(type='dict'),
|
||||||
metadata=dict(type='dict'),
|
metadata=dict(type='dict'),
|
||||||
machine_type=dict(type='str'),
|
machine_type=dict(type='str'),
|
||||||
min_cpu_platform=dict(type='str'),
|
min_cpu_platform=dict(type='str'),
|
||||||
|
@ -920,9 +908,7 @@ def main():
|
||||||
access_configs=dict(
|
access_configs=dict(
|
||||||
type='list',
|
type='list',
|
||||||
elements='dict',
|
elements='dict',
|
||||||
options=dict(
|
options=dict(name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str')),
|
||||||
name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
alias_ip_ranges=dict(type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))),
|
alias_ip_ranges=dict(type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))),
|
||||||
network=dict(type='dict'),
|
network=dict(type='dict'),
|
||||||
|
@ -934,7 +920,7 @@ def main():
|
||||||
type='dict', options=dict(automatic_restart=dict(type='bool'), on_host_maintenance=dict(type='str'), preemptible=dict(type='bool'))
|
type='dict', options=dict(automatic_restart=dict(type='bool'), on_host_maintenance=dict(type='str'), preemptible=dict(type='bool'))
|
||||||
),
|
),
|
||||||
service_accounts=dict(type='list', elements='dict', options=dict(email=dict(type='str'), scopes=dict(type='list', elements='str'))),
|
service_accounts=dict(type='list', elements='dict', options=dict(email=dict(type='str'), scopes=dict(type='list', elements='str'))),
|
||||||
status=dict(type='str', choices=['PROVISIONING', 'STAGING', 'RUNNING', 'STOPPING', 'SUSPENDING', 'SUSPENDED', 'TERMINATED']),
|
status=dict(type='str'),
|
||||||
tags=dict(type='dict', options=dict(fingerprint=dict(type='str'), items=dict(type='list', elements='str'))),
|
tags=dict(type='dict', options=dict(fingerprint=dict(type='str'), items=dict(type='list', elements='str'))),
|
||||||
zone=dict(required=True, type='str'),
|
zone=dict(required=True, type='str'),
|
||||||
)
|
)
|
||||||
|
@ -987,10 +973,20 @@ def update(module, link, kind, fetch):
|
||||||
|
|
||||||
|
|
||||||
def update_fields(module, request, response):
|
def update_fields(module, request, response):
|
||||||
|
if response.get('labels') != request.get('labels'):
|
||||||
|
label_fingerprint_update(module, request, response)
|
||||||
if response.get('machineType') != request.get('machineType'):
|
if response.get('machineType') != request.get('machineType'):
|
||||||
machine_type_update(module, request, response)
|
machine_type_update(module, request, response)
|
||||||
|
|
||||||
|
|
||||||
|
def label_fingerprint_update(module, request, response):
|
||||||
|
auth = GcpSession(module, 'compute')
|
||||||
|
auth.post(
|
||||||
|
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/instances/{name}/setLabels"]).format(**module.params),
|
||||||
|
{u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def machine_type_update(module, request, response):
|
def machine_type_update(module, request, response):
|
||||||
auth = GcpSession(module, 'compute')
|
auth = GcpSession(module, 'compute')
|
||||||
auth.post(
|
auth.post(
|
||||||
|
@ -1010,7 +1006,7 @@ def resource_to_request(module):
|
||||||
u'canIpForward': module.params.get('can_ip_forward'),
|
u'canIpForward': module.params.get('can_ip_forward'),
|
||||||
u'disks': InstanceDisksArray(module.params.get('disks', []), module).to_request(),
|
u'disks': InstanceDisksArray(module.params.get('disks', []), module).to_request(),
|
||||||
u'guestAccelerators': InstanceGuestacceleratorsArray(module.params.get('guest_accelerators', []), module).to_request(),
|
u'guestAccelerators': InstanceGuestacceleratorsArray(module.params.get('guest_accelerators', []), module).to_request(),
|
||||||
u'labelFingerprint': module.params.get('label_fingerprint'),
|
u'labels': module.params.get('labels'),
|
||||||
u'metadata': module.params.get('metadata'),
|
u'metadata': module.params.get('metadata'),
|
||||||
u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params),
|
u'machineType': machine_type_selflink(module.params.get('machine_type'), module.params),
|
||||||
u'minCpuPlatform': module.params.get('min_cpu_platform'),
|
u'minCpuPlatform': module.params.get('min_cpu_platform'),
|
||||||
|
@ -1096,6 +1092,7 @@ def response_to_hash(module, response):
|
||||||
u'guestAccelerators': InstanceGuestacceleratorsArray(response.get(u'guestAccelerators', []), module).from_response(),
|
u'guestAccelerators': InstanceGuestacceleratorsArray(response.get(u'guestAccelerators', []), module).from_response(),
|
||||||
u'id': response.get(u'id'),
|
u'id': response.get(u'id'),
|
||||||
u'labelFingerprint': response.get(u'labelFingerprint'),
|
u'labelFingerprint': response.get(u'labelFingerprint'),
|
||||||
|
u'labels': response.get(u'labels'),
|
||||||
u'metadata': response.get(u'metadata'),
|
u'metadata': response.get(u'metadata'),
|
||||||
u'machineType': response.get(u'machineType'),
|
u'machineType': response.get(u'machineType'),
|
||||||
u'minCpuPlatform': response.get(u'minCpuPlatform'),
|
u'minCpuPlatform': response.get(u'minCpuPlatform'),
|
||||||
|
|
|
@ -258,13 +258,15 @@ resources:
|
||||||
type: int
|
type: int
|
||||||
labelFingerprint:
|
labelFingerprint:
|
||||||
description:
|
description:
|
||||||
- A fingerprint for this request, which is essentially a hash of the metadata's
|
- The fingerprint used for optimistic locking of this resource. Used internally
|
||||||
contents and used for optimistic locking. The fingerprint is initially generated
|
during updates.
|
||||||
by Compute Engine and changes 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.
|
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
|
labels:
|
||||||
|
description:
|
||||||
|
- Labels to apply to this instance. A list of key->value pairs.
|
||||||
|
returned: success
|
||||||
|
type: dict
|
||||||
metadata:
|
metadata:
|
||||||
description:
|
description:
|
||||||
- The metadata key/value pairs to assign to instances that are created from
|
- The metadata key/value pairs to assign to instances that are created from
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
zone:
|
zone:
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
zone:
|
zone:
|
||||||
|
|
|
@ -180,18 +180,14 @@ options:
|
||||||
either SCSI or NVME. The default is SCSI.
|
either SCSI or NVME. The default is SCSI.
|
||||||
- Persistent disks must always use SCSI and the request will fail if you
|
- Persistent disks must always use SCSI and the request will fail if you
|
||||||
attempt to attach a persistent disk in any other format than SCSI.
|
attempt to attach a persistent disk in any other format than SCSI.
|
||||||
|
- 'Some valid choices include: "SCSI", "NVME"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- SCSI
|
|
||||||
- NVME
|
|
||||||
mode:
|
mode:
|
||||||
description:
|
description:
|
||||||
- The mode in which to attach this disk, either READ_WRITE or READ_ONLY.
|
- 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.
|
If not specified, the default is to attach the disk in READ_WRITE mode.
|
||||||
|
- 'Some valid choices include: "READ_WRITE", "READ_ONLY"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- READ_WRITE
|
|
||||||
- READ_ONLY
|
|
||||||
source:
|
source:
|
||||||
description:
|
description:
|
||||||
- Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
|
- Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
|
||||||
|
@ -210,10 +206,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not
|
- Specifies the type of the disk, either SCRATCH or PERSISTENT. If not
|
||||||
specified, the default is PERSISTENT.
|
specified, the default is PERSISTENT.
|
||||||
|
- 'Some valid choices include: "SCRATCH", "PERSISTENT"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- SCRATCH
|
|
||||||
- PERSISTENT
|
|
||||||
machine_type:
|
machine_type:
|
||||||
description:
|
description:
|
||||||
- The machine type to use in the VM instance template.
|
- The machine type to use in the VM instance template.
|
||||||
|
@ -281,9 +275,8 @@ options:
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
|
- The type of configuration. The default and only option is ONE_TO_ONE_NAT.
|
||||||
|
- 'Some valid choices include: "ONE_TO_ONE_NAT"'
|
||||||
required: true
|
required: true
|
||||||
choices:
|
|
||||||
- ONE_TO_ONE_NAT
|
|
||||||
alias_ip_ranges:
|
alias_ip_ranges:
|
||||||
description:
|
description:
|
||||||
- An array of alias IP ranges for this network interface. Can only be
|
- An array of alias IP ranges for this network interface. Can only be
|
||||||
|
@ -875,10 +868,10 @@ def main():
|
||||||
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
interface=dict(type='str', choices=['SCSI', 'NVME']),
|
interface=dict(type='str'),
|
||||||
mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']),
|
mode=dict(type='str'),
|
||||||
source=dict(type='dict'),
|
source=dict(type='dict'),
|
||||||
type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']),
|
type=dict(type='str'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
machine_type=dict(required=True, type='str'),
|
machine_type=dict(required=True, type='str'),
|
||||||
|
@ -892,11 +885,7 @@ def main():
|
||||||
access_configs=dict(
|
access_configs=dict(
|
||||||
type='list',
|
type='list',
|
||||||
elements='dict',
|
elements='dict',
|
||||||
options=dict(
|
options=dict(name=dict(required=True, type='str'), nat_ip=dict(type='dict'), type=dict(required=True, type='str')),
|
||||||
name=dict(required=True, type='str'),
|
|
||||||
nat_ip=dict(type='dict'),
|
|
||||||
type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT']),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
alias_ip_ranges=dict(
|
alias_ip_ranges=dict(
|
||||||
type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))
|
type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))
|
||||||
|
@ -1090,14 +1079,19 @@ def raise_if_errors(response, err_path, module):
|
||||||
|
|
||||||
|
|
||||||
def encode_request(request, module):
|
def encode_request(request, module):
|
||||||
if 'metadata' in request and request['metadata'] is not None:
|
if 'properties' in request and request['properties'] is not None and 'metadata' in request['properties'] and request['properties']['metadata'] is not None:
|
||||||
request['metadata'] = metadata_encoder(request['metadata'])
|
request['properties']['metadata'] = metadata_encoder(request['properties']['metadata'])
|
||||||
return request
|
return request
|
||||||
|
|
||||||
|
|
||||||
def decode_response(response, module):
|
def decode_response(response, module):
|
||||||
if 'metadata' in response and response['metadata'] is not None:
|
if (
|
||||||
response['metadata'] = metadata_decoder(response['metadata'])
|
'properties' in response
|
||||||
|
and response['properties'] is not None
|
||||||
|
and 'metadata' in response['properties']
|
||||||
|
and response['properties']['metadata'] is not None
|
||||||
|
):
|
||||||
|
response['properties']['metadata'] = metadata_decoder(response['properties']['metadata'])
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
|
|
|
@ -70,11 +70,8 @@ options:
|
||||||
type:
|
type:
|
||||||
description:
|
description:
|
||||||
- The type of InterconnectAttachment you wish to create. Defaults to DEDICATED.
|
- The type of InterconnectAttachment you wish to create. Defaults to DEDICATED.
|
||||||
|
- 'Some valid choices include: "DEDICATED", "PARTNER", "PARTNER_PROVIDER"'
|
||||||
required: false
|
required: false
|
||||||
choices:
|
|
||||||
- DEDICATED
|
|
||||||
- PARTNER
|
|
||||||
- PARTNER_PROVIDER
|
|
||||||
router:
|
router:
|
||||||
description:
|
description:
|
||||||
- URL of the cloud router to be used for dynamic routing. This router must be
|
- URL of the cloud router to be used for dynamic routing. This router must be
|
||||||
|
@ -284,7 +281,7 @@ def main():
|
||||||
interconnect=dict(type='str'),
|
interconnect=dict(type='str'),
|
||||||
description=dict(type='str'),
|
description=dict(type='str'),
|
||||||
edge_availability_domain=dict(type='str'),
|
edge_availability_domain=dict(type='str'),
|
||||||
type=dict(type='str', choices=['DEDICATED', 'PARTNER', 'PARTNER_PROVIDER']),
|
type=dict(type='str'),
|
||||||
router=dict(required=True, type='dict'),
|
router=dict(required=True, type='dict'),
|
||||||
name=dict(required=True, type='str'),
|
name=dict(required=True, type='str'),
|
||||||
candidate_subnets=dict(type='list', elements='str'),
|
candidate_subnets=dict(type='list', elements='str'),
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
region:
|
region:
|
||||||
|
|
|
@ -94,10 +94,8 @@ options:
|
||||||
in the same region as the router. If set to `GLOBAL`, this network's cloud
|
in the same region as the router. If set to `GLOBAL`, this network's cloud
|
||||||
routers will advertise routes with all subnetworks of this network, across
|
routers will advertise routes with all subnetworks of this network, across
|
||||||
regions.
|
regions.
|
||||||
|
- 'Some valid choices include: "REGIONAL", "GLOBAL"'
|
||||||
required: true
|
required: true
|
||||||
choices:
|
|
||||||
- REGIONAL
|
|
||||||
- GLOBAL
|
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
notes:
|
notes:
|
||||||
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/networks)'
|
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/v1/networks)'
|
||||||
|
@ -213,7 +211,7 @@ def main():
|
||||||
ipv4_range=dict(type='str'),
|
ipv4_range=dict(type='str'),
|
||||||
name=dict(required=True, type='str'),
|
name=dict(required=True, type='str'),
|
||||||
auto_create_subnetworks=dict(type='bool'),
|
auto_create_subnetworks=dict(type='bool'),
|
||||||
routing_config=dict(type='dict', options=dict(routing_mode=dict(required=True, type='str', choices=['REGIONAL', 'GLOBAL']))),
|
routing_config=dict(type='dict', options=dict(routing_mode=dict(required=True, type='str'))),
|
||||||
),
|
),
|
||||||
mutually_exclusive=[['auto_create_subnetworks', 'ipv4_range']],
|
mutually_exclusive=[['auto_create_subnetworks', 'ipv4_range']],
|
||||||
)
|
)
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
region:
|
region:
|
||||||
|
|
|
@ -42,7 +42,7 @@ requirements:
|
||||||
options:
|
options:
|
||||||
filters:
|
filters:
|
||||||
description:
|
description:
|
||||||
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters.)
|
- A list of filter value pairs. Available filters are listed here U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
|
||||||
- Each additional filter in the list will act be added as an AND condition (filter1
|
- Each additional filter in the list will act be added as an AND condition (filter1
|
||||||
and filter2) .
|
and filter2) .
|
||||||
extends_documentation_fragment: gcp
|
extends_documentation_fragment: gcp
|
||||||
|
|
|
@ -52,6 +52,8 @@
|
||||||
metadata:
|
metadata:
|
||||||
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
||||||
cost-center: '12345'
|
cost-center: '12345'
|
||||||
|
labels:
|
||||||
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
access_configs:
|
access_configs:
|
||||||
|
@ -75,6 +77,8 @@
|
||||||
metadata:
|
metadata:
|
||||||
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
||||||
cost-center: '12345'
|
cost-center: '12345'
|
||||||
|
labels:
|
||||||
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
access_configs:
|
access_configs:
|
||||||
|
@ -119,6 +123,8 @@
|
||||||
metadata:
|
metadata:
|
||||||
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
||||||
cost-center: '12345'
|
cost-center: '12345'
|
||||||
|
labels:
|
||||||
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
access_configs:
|
access_configs:
|
||||||
|
@ -148,6 +154,8 @@
|
||||||
metadata:
|
metadata:
|
||||||
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
||||||
cost-center: '12345'
|
cost-center: '12345'
|
||||||
|
labels:
|
||||||
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
access_configs:
|
access_configs:
|
||||||
|
@ -192,6 +200,8 @@
|
||||||
metadata:
|
metadata:
|
||||||
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
startup-script-url: gs:://graphite-playground/bootstrap.sh
|
||||||
cost-center: '12345'
|
cost-center: '12345'
|
||||||
|
labels:
|
||||||
|
environment: production
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- network: "{{ network }}"
|
- network: "{{ network }}"
|
||||||
access_configs:
|
access_configs:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue