Bug fixes for GCP modules (as of 2019-01-09T15:35:45-08:00) (#50784)

This commit is contained in:
Alex Stephen 2019-01-16 11:15:15 -08:00 committed by ansibot
parent 5ca5936e05
commit 41c1f8b9a5
28 changed files with 230 additions and 197 deletions

View file

@ -187,6 +187,17 @@ items:
key that protects this resource. key that protects this resource.
returned: success returned: success
type: str type: str
labels:
description:
- Labels to apply to this Image.
returned: success
type: dict
labelFingerprint:
description:
- The fingerprint used for optimistic locking of this resource. Used internally
during updates.
returned: success
type: str
licenses: licenses:
description: description:
- Any applicable license URI. - Any applicable license URI.
@ -229,10 +240,11 @@ items:
type: str type: str
sourceDisk: sourceDisk:
description: description:
- Refers to a gcompute_disk object You must provide either this property or - The source disk to create this image based on.
the rawDisk.source property but not both to create an image. - You must provide either this property or the rawDisk.source property but not
both to create an image.
returned: success returned: success
type: dict type: str
sourceDiskEncryptionKey: sourceDiskEncryptionKey:
description: description:
- The customer-supplied encryption key of the source disk. Required if the source - The customer-supplied encryption key of the source disk. Required if the source

View file

@ -127,7 +127,7 @@ options:
required: false required: false
disk_type: disk_type:
description: description:
- Reference to a gcompute_disk_type resource. - Reference to a disk type.
- Specifies the disk type to use to create the instance. - Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard. - If not specified, the default is pd-standard.
required: false required: false
@ -177,15 +177,14 @@ options:
- READ_ONLY - READ_ONLY
source: source:
description: description:
- Reference to a gcompute_disk resource. When creating a new instance, one - Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
of initializeParams.sourceImage or disks.source is required. or disks.source is required.
- If desired, you can also attach existing non-root persistent disks using - If desired, you can also attach existing non-root persistent disks using
this property. This field is only applicable for persistent disks. this property. This field is only applicable for persistent disks.
- 'This field represents a link to a Disk resource in GCP. It can be specified - 'This field represents a link to a Disk resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_disk in two ways. First, you can place in the selfLink of the resource here as
task and then set this source field to "{{ name-of-resource }}" Alternatively, a string Alternatively, you can add `register: name-of-resource` to a gcp_compute_disk
you can set this source to a dictionary with the selfLink key where the task and then set this source field to "{{ name-of-resource }}"'
value is the selfLink of your Disk'
required: false required: false
type: type:
description: description:
@ -261,17 +260,17 @@ options:
required: true required: true
nat_ip: nat_ip:
description: description:
- Specifies the title of a gcompute_address. - Reference to an address.
- An external IP address associated with this instance. - An external IP address associated with this instance.
- Specify an unused static external IP address available to the project - Specify an unused static external IP address available to the project
or leave this field undefined to use an IP from a shared ephemeral IP or leave this field undefined to use an IP from a shared ephemeral IP
address pool. If you specify a static external IP address, it must live address pool. If you specify a static external IP address, it must live
in the same region as the zone of the instance. in the same region as the zone of the instance.
- 'This field represents a link to a Address resource in GCP. It can be - 'This field represents a link to a Address resource in GCP. It can be
specified in two ways. You can add `register: name-of-resource` to a specified in two ways. First, you can place in the address of the resource
gcp_compute_address task and then set this nat_ip field to "{{ name-of-resource here as a string Alternatively, you can add `register: name-of-resource`
}}" Alternatively, you can set this nat_ip to a dictionary with the to a gcp_compute_address task and then set this nat_ip field to "{{
address key where the value is the address of your Address' name-of-resource }}"'
required: false required: false
type: type:
description: description:
@ -306,15 +305,14 @@ options:
required: false required: false
network: network:
description: description:
- Specifies the title of an existing gcompute_network. When creating an instance, - Specifies the title of an existing network. When creating an instance, if
if neither the network nor the subnetwork is specified, the default network neither the network nor the subnetwork is specified, the default network
global/networks/default is used; if the network is not specified but the global/networks/default is used; if the network is not specified but the
subnetwork is specified, the network is inferred. subnetwork is specified, the network is inferred.
- 'This field represents a link to a Network resource in GCP. It can be specified - 'This field represents a link to a Network resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_network in two ways. First, you can place in the selfLink of the resource here as
task and then set this network field to "{{ name-of-resource }}" Alternatively, a string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network
you can set this network to a dictionary with the selfLink key where the task and then set this network field to "{{ name-of-resource }}"'
value is the selfLink of your Network'
required: false required: false
network_ip: network_ip:
description: description:
@ -324,15 +322,15 @@ options:
required: false required: false
subnetwork: subnetwork:
description: description:
- Reference to a gcompute_subnetwork resource. - Reference to a VPC network.
- If the network resource is in legacy mode, do not provide this property. - If the network resource is in legacy mode, do not provide this property.
If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in auto subnet mode, providing the subnetwork is optional.
If the network is in custom subnet mode, then this field should be specified. If the network is in custom subnet mode, then this field should be specified.
- 'This field represents a link to a Subnetwork resource in GCP. It can be - 'This field represents a link to a Subnetwork resource in GCP. It can be
specified in two ways. You can add `register: name-of-resource` to a gcp_compute_subnetwork specified in two ways. First, you can place in the selfLink of the resource
task and then set this subnetwork field to "{{ name-of-resource }}" Alternatively, here as a string Alternatively, you can add `register: name-of-resource`
you can set this subnetwork to a dictionary with the selfLink key where to a gcp_compute_subnetwork task and then set this subnetwork field to "{{
the value is the selfLink of your Subnetwork' name-of-resource }}"'
required: false required: false
scheduling: scheduling:
description: description:
@ -574,7 +572,7 @@ disks:
type: int type: int
diskType: diskType:
description: description:
- Reference to a gcompute_disk_type resource. - Reference to a disk type.
- Specifies the disk type to use to create the instance. - Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard. - If not specified, the default is pd-standard.
returned: success returned: success
@ -625,12 +623,12 @@ disks:
type: str type: str
source: source:
description: description:
- Reference to a gcompute_disk resource. When creating a new instance, one of - Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
initializeParams.sourceImage or disks.source is required. or disks.source is required.
- If desired, you can also attach existing non-root persistent disks using this - If desired, you can also attach existing non-root persistent disks using this
property. This field is only applicable for persistent disks. property. This field is only applicable for persistent disks.
returned: success returned: success
type: dict type: str
type: type:
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,
@ -719,14 +717,14 @@ networkInterfaces:
type: str type: str
natIP: natIP:
description: description:
- Specifies the title of a gcompute_address. - Reference to an address.
- An external IP address associated with this instance. - An external IP address associated with this instance.
- Specify an unused static external IP address available to the project - Specify an unused static external IP address available to the project
or leave this field undefined to use an IP from a shared ephemeral IP or leave this field undefined to use an IP from a shared ephemeral IP
address pool. If you specify a static external IP address, it must live address pool. If you specify a static external IP address, it must live
in the same region as the zone of the instance. in the same region as the zone of the instance.
returned: success returned: success
type: dict type: str
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.
@ -763,12 +761,12 @@ networkInterfaces:
type: str type: str
network: network:
description: description:
- Specifies the title of an existing gcompute_network. When creating an instance, - Specifies the title of an existing network. When creating an instance, if
if neither the network nor the subnetwork is specified, the default network neither the network nor the subnetwork is specified, the default network global/networks/default
global/networks/default is used; if the network is not specified but the subnetwork is used; if the network is not specified but the subnetwork is specified,
is specified, the network is inferred. the network is inferred.
returned: success returned: success
type: dict type: str
networkIP: networkIP:
description: description:
- An IPv4 internal network address to assign to the instance for this network - An IPv4 internal network address to assign to the instance for this network
@ -778,12 +776,12 @@ networkInterfaces:
type: str type: str
subnetwork: subnetwork:
description: description:
- Reference to a gcompute_subnetwork resource. - Reference to a VPC network.
- If the network resource is in legacy mode, do not provide this property. If - If the network resource is in legacy mode, do not provide this property. If
the network is in auto subnet mode, providing the subnetwork is optional. the network is in auto subnet mode, providing the subnetwork is optional.
If the network is in custom subnet mode, then this field should be specified. If the network is in custom subnet mode, then this field should be specified.
returned: success returned: success
type: dict type: str
scheduling: scheduling:
description: description:
- Sets the scheduling options for this instance. - Sets the scheduling options for this instance.
@ -915,7 +913,7 @@ def main():
)), )),
interface=dict(type='str', choices=['SCSI', 'NVME']), interface=dict(type='str', choices=['SCSI', 'NVME']),
mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']), mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']),
source=dict(type='dict'), source=dict(),
type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']) type=dict(type='str', choices=['SCRATCH', 'PERSISTENT'])
)), )),
guest_accelerators=dict(type='list', elements='dict', options=dict( guest_accelerators=dict(type='list', elements='dict', options=dict(
@ -930,7 +928,7 @@ def main():
network_interfaces=dict(type='list', elements='dict', options=dict( network_interfaces=dict(type='list', elements='dict', options=dict(
access_configs=dict(type='list', elements='dict', options=dict( access_configs=dict(type='list', elements='dict', options=dict(
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
nat_ip=dict(type='dict'), nat_ip=dict(),
type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT']) type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])
)), )),
alias_ip_ranges=dict(type='list', elements='dict', options=dict( alias_ip_ranges=dict(type='list', elements='dict', options=dict(
@ -938,9 +936,9 @@ def main():
subnetwork_range_name=dict(type='str') subnetwork_range_name=dict(type='str')
)), )),
name=dict(type='str'), name=dict(type='str'),
network=dict(type='dict'), network=dict(),
network_ip=dict(type='str'), network_ip=dict(type='str'),
subnetwork=dict(type='dict') subnetwork=dict()
)), )),
scheduling=dict(type='dict', options=dict( scheduling=dict(type='dict', options=dict(
automatic_restart=dict(type='bool'), automatic_restart=dict(type='bool'),
@ -1200,7 +1198,7 @@ def decode_response(response, module):
return response return response
# TODO(alexstephen): Implement updating metadata on exsiting resources. # TODO(alexstephen): Implement updating metadata on existing resources.
# Expose instance 'metadata' as a simple name/value pair hash. However the API # Expose instance 'metadata' as a simple name/value pair hash. However the API
# defines metadata as a NestedObject with the following layout: # defines metadata as a NestedObject with the following layout:

View file

@ -169,7 +169,7 @@ items:
type: int type: int
diskType: diskType:
description: description:
- Reference to a gcompute_disk_type resource. - Reference to a disk type.
- Specifies the disk type to use to create the instance. - Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard. - If not specified, the default is pd-standard.
returned: success returned: success
@ -221,12 +221,12 @@ items:
type: str type: str
source: source:
description: description:
- Reference to a gcompute_disk resource. When creating a new instance, one - Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
of initializeParams.sourceImage or disks.source is required. or disks.source is required.
- If desired, you can also attach existing non-root persistent disks using - If desired, you can also attach existing non-root persistent disks using
this property. This field is only applicable for persistent disks. this property. This field is only applicable for persistent disks.
returned: success returned: success
type: dict type: str
type: type:
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,
@ -317,14 +317,14 @@ items:
type: str type: str
natIP: natIP:
description: description:
- Specifies the title of a gcompute_address. - Reference to an address.
- An external IP address associated with this instance. - An external IP address associated with this instance.
- Specify an unused static external IP address available to the project - Specify an unused static external IP address available to the project
or leave this field undefined to use an IP from a shared ephemeral or leave this field undefined to use an IP from a shared ephemeral
IP address pool. If you specify a static external IP address, it must IP address pool. If you specify a static external IP address, it must
live in the same region as the zone of the instance. live in the same region as the zone of the instance.
returned: success returned: success
type: dict type: str
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.
@ -361,12 +361,12 @@ items:
type: str type: str
network: network:
description: description:
- Specifies the title of an existing gcompute_network. When creating an - Specifies the title of an existing network. When creating an instance,
instance, if neither the network nor the subnetwork is specified, the if neither the network nor the subnetwork is specified, the default network
default network global/networks/default is used; if the network is not global/networks/default is used; if the network is not specified but the
specified but the subnetwork is specified, the network is inferred. subnetwork is specified, the network is inferred.
returned: success returned: success
type: dict type: str
networkIP: networkIP:
description: description:
- An IPv4 internal network address to assign to the instance for this network - An IPv4 internal network address to assign to the instance for this network
@ -376,12 +376,12 @@ items:
type: str type: str
subnetwork: subnetwork:
description: description:
- Reference to a gcompute_subnetwork resource. - Reference to a VPC network.
- If the network resource is in legacy mode, do not provide this property. - If the network resource is in legacy mode, do not provide this property.
If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in auto subnet mode, providing the subnetwork is optional.
If the network is in custom subnet mode, then this field should be specified. If the network is in custom subnet mode, then this field should be specified.
returned: success returned: success
type: dict type: str
scheduling: scheduling:
description: description:
- Sets the scheduling options for this instance. - Sets the scheduling options for this instance.

View file

@ -84,10 +84,9 @@ options:
description: description:
- The network to which all instances in the instance group belong. - The network to which all instances in the instance group belong.
- 'This field represents a link to a Network resource in GCP. It can be specified - 'This field represents a link to a Network resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_network in two ways. First, you can place in the selfLink of the resource here as a
task and then set this network field to "{{ name-of-resource }}" Alternatively, string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network
you can set this network to a dictionary with the selfLink key where the value task and then set this network field to "{{ name-of-resource }}"'
is the selfLink of your Network'
required: false required: false
region: region:
description: description:
@ -97,10 +96,9 @@ options:
description: description:
- The subnetwork to which all instances in the instance group belong. - The subnetwork to which all instances in the instance group belong.
- 'This field represents a link to a Subnetwork resource in GCP. It can be specified - 'This field represents a link to a Subnetwork resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_subnetwork in two ways. First, you can place in the selfLink of the resource here as a
task and then set this subnetwork field to "{{ name-of-resource }}" Alternatively, string Alternatively, you can add `register: name-of-resource` to a gcp_compute_subnetwork
you can set this subnetwork to a dictionary with the selfLink key where the task and then set this subnetwork field to "{{ name-of-resource }}"'
value is the selfLink of your Subnetwork'
required: false required: false
zone: zone:
description: description:
@ -191,7 +189,7 @@ network:
description: description:
- The network to which all instances in the instance group belong. - The network to which all instances in the instance group belong.
returned: success returned: success
type: dict type: str
region: region:
description: description:
- The region where the instance group is located (for regional resources). - The region where the instance group is located (for regional resources).
@ -201,7 +199,7 @@ subnetwork:
description: description:
- The subnetwork to which all instances in the instance group belong. - The subnetwork to which all instances in the instance group belong.
returned: success returned: success
type: dict type: str
zone: zone:
description: description:
- A reference to the zone where the instance group resides. - A reference to the zone where the instance group resides.
@ -244,11 +242,11 @@ def main():
name=dict(type='str'), name=dict(type='str'),
port=dict(type='int') port=dict(type='int')
)), )),
network=dict(type='dict'), network=dict(),
region=dict(type='str'), region=dict(type='str'),
subnetwork=dict(type='dict'), subnetwork=dict(),
zone=dict(required=True, type='str'), zone=dict(required=True, type='str'),
instances=dict(type='list', elements='dict') instances=dict(type='list')
) )
) )

View file

@ -118,7 +118,7 @@ items:
description: description:
- The network to which all instances in the instance group belong. - The network to which all instances in the instance group belong.
returned: success returned: success
type: dict type: str
region: region:
description: description:
- The region where the instance group is located (for regional resources). - The region where the instance group is located (for regional resources).
@ -128,7 +128,7 @@ items:
description: description:
- The subnetwork to which all instances in the instance group belong. - The subnetwork to which all instances in the instance group belong.
returned: success returned: success
type: dict type: str
zone: zone:
description: description:
- A reference to the zone where the instance group resides. - A reference to the zone where the instance group resides.

View file

@ -71,10 +71,10 @@ options:
group uses this template to create all new instances in the managed instance group uses this template to create all new instances in the managed instance
group. group.
- 'This field represents a link to a InstanceTemplate resource in GCP. It can - 'This field represents a link to a InstanceTemplate resource in GCP. It can
be specified in two ways. You can add `register: name-of-resource` to a gcp_compute_instance_template be specified in two ways. First, you can place in the selfLink of the resource
task and then set this instance_template field to "{{ name-of-resource }}" Alternatively, here as a string Alternatively, you can add `register: name-of-resource` to
you can set this instance_template to a dictionary with the selfLink key where a gcp_compute_instance_template task and then set this instance_template field
the value is the selfLink of your InstanceTemplate' to "{{ name-of-resource }}"'
required: true required: true
name: name:
description: description:
@ -262,13 +262,13 @@ instanceGroup:
description: description:
- The instance group being managed. - The instance group being managed.
returned: success returned: success
type: dict type: str
instanceTemplate: instanceTemplate:
description: description:
- The instance template that is specified for this managed instance group. The group - The instance template that is specified for this managed instance group. The group
uses this template to create all new instances in the managed instance group. uses this template to create all new instances in the managed instance group.
returned: success returned: success
type: dict type: str
name: name:
description: description:
- The name of the managed instance group. The name must be 1-63 characters long, - The name of the managed instance group. The name must be 1-63 characters long,
@ -340,13 +340,13 @@ def main():
state=dict(default='present', choices=['present', 'absent'], type='str'), state=dict(default='present', choices=['present', 'absent'], type='str'),
base_instance_name=dict(required=True, type='str'), base_instance_name=dict(required=True, type='str'),
description=dict(type='str'), description=dict(type='str'),
instance_template=dict(required=True, type='dict'), instance_template=dict(required=True),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
named_ports=dict(type='list', elements='dict', options=dict( named_ports=dict(type='list', elements='dict', options=dict(
name=dict(type='str'), name=dict(type='str'),
port=dict(type='int') port=dict(type='int')
)), )),
target_pools=dict(type='list', elements='dict'), target_pools=dict(type='list'),
target_size=dict(type='int'), target_size=dict(type='int'),
zone=dict(required=True, type='str') zone=dict(required=True, type='str')
) )

View file

@ -162,14 +162,14 @@ items:
description: description:
- The instance group being managed. - The instance group being managed.
returned: success returned: success
type: dict type: str
instanceTemplate: instanceTemplate:
description: description:
- The instance template that is specified for this managed instance group. The - The instance template that is specified for this managed instance group. The
group uses this template to create all new instances in the managed instance group uses this template to create all new instances in the managed instance
group. group.
returned: success returned: success
type: dict type: str
name: name:
description: description:
- The name of the managed instance group. The name must be 1-63 characters long, - The name of the managed instance group. The name must be 1-63 characters long,

View file

@ -154,7 +154,7 @@ options:
required: false required: false
disk_type: disk_type:
description: description:
- Reference to a gcompute_disk_type resource. - Reference to a disk type.
- Specifies the disk type to use to create the instance. - Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard. - If not specified, the default is pd-standard.
required: false required: false
@ -205,17 +205,17 @@ options:
- READ_ONLY - READ_ONLY
source: source:
description: description:
- Reference to a gcompute_disk resource. When creating a new instance, - Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
one of initializeParams.sourceImage or disks.source is required. or disks.source is required.
- If desired, you can also attach existing non-root persistent disks using - If desired, you can also attach existing non-root persistent disks using
this property. This field is only applicable for persistent disks. this property. This field is only applicable for persistent disks.
- Note that for InstanceTemplate, specify the disk name, not the URL for - Note that for InstanceTemplate, specify the disk name, not the URL for
the disk. the disk.
- 'This field represents a link to a Disk resource in GCP. It can be specified - 'This field represents a link to a Disk resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_disk in two ways. First, you can place in the name of the resource here as
task and then set this source field to "{{ name-of-resource }}" Alternatively, a string Alternatively, you can add `register: name-of-resource` to
you can set this source to a dictionary with the name key where the a gcp_compute_disk task and then set this source field to "{{ name-of-resource
value is the name of your Disk' }}"'
required: false required: false
type: type:
description: description:
@ -227,7 +227,7 @@ options:
- PERSISTENT - PERSISTENT
machine_type: machine_type:
description: description:
- Reference to a gcompute_machine_type resource. - The machine type to use in the VM instance template.
required: true required: true
min_cpu_platform: min_cpu_platform:
description: description:
@ -277,18 +277,17 @@ options:
required: true required: true
nat_ip: nat_ip:
description: description:
- Specifies the title of a gcompute_address. - Reference to an address.
- An external IP address associated with this instance. - An external IP address associated with this instance.
- Specify an unused static external IP address available to the project - Specify an unused static external IP address available to the project
or leave this field undefined to use an IP from a shared ephemeral or leave this field undefined to use an IP from a shared ephemeral
IP address pool. If you specify a static external IP address, it IP address pool. If you specify a static external IP address, it
must live in the same region as the zone of the instance. must live in the same region as the zone of the instance.
- 'This field represents a link to a Address resource in GCP. It can - 'This field represents a link to a Address resource in GCP. It can
be specified in two ways. You can add `register: name-of-resource` be specified in two ways. First, you can place in the address of
to a gcp_compute_address task and then set this nat_ip field to the resource here as a string Alternatively, you can add `register:
"{{ name-of-resource }}" Alternatively, you can set this nat_ip name-of-resource` to a gcp_compute_address task and then set this
to a dictionary with the address key where the value is the address nat_ip field to "{{ name-of-resource }}"'
of your Address'
required: false required: false
type: type:
description: description:
@ -324,15 +323,15 @@ options:
required: false required: false
network: network:
description: description:
- Specifies the title of an existing gcompute_network. When creating an - Specifies the title of an existing network. When creating an instance,
instance, if neither the network nor the subnetwork is specified, the if neither the network nor the subnetwork is specified, the default
default network global/networks/default is used; if the network is not network global/networks/default is used; if the network is not specified
specified but the subnetwork is specified, the network is inferred. but the subnetwork is specified, the network is inferred.
- 'This field represents a link to a Network resource in GCP. It can be - 'This field represents a link to a Network resource in GCP. It can be
specified in two ways. You can add `register: name-of-resource` to a specified in two ways. First, you can place in the selfLink of the resource
gcp_compute_network task and then set this network field to "{{ name-of-resource here as a string Alternatively, you can add `register: name-of-resource`
}}" Alternatively, you can set this network to a dictionary with the to a gcp_compute_network task and then set this network field to "{{
selfLink key where the value is the selfLink of your Network' name-of-resource }}"'
required: false required: false
network_ip: network_ip:
description: description:
@ -342,16 +341,15 @@ options:
required: false required: false
subnetwork: subnetwork:
description: description:
- Reference to a gcompute_subnetwork resource. - Reference to a VPC network.
- If the network resource is in legacy mode, do not provide this property. - If the network resource is in legacy mode, do not provide this property.
If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in auto subnet mode, providing the subnetwork is optional.
If the network is in custom subnet mode, then this field should be specified. If the network is in custom subnet mode, then this field should be specified.
- 'This field represents a link to a Subnetwork resource in GCP. It can - 'This field represents a link to a Subnetwork resource in GCP. It can
be specified in two ways. You can add `register: name-of-resource` to be specified in two ways. First, you can place in the selfLink of the
a gcp_compute_subnetwork task and then set this subnetwork field to resource here as a string Alternatively, you can add `register: name-of-resource`
"{{ name-of-resource }}" Alternatively, you can set this subnetwork to a gcp_compute_subnetwork task and then set this subnetwork field
to a dictionary with the selfLink key where the value is the selfLink to "{{ name-of-resource }}"'
of your Subnetwork'
required: false required: false
scheduling: scheduling:
description: description:
@ -585,7 +583,7 @@ properties:
type: int type: int
diskType: diskType:
description: description:
- Reference to a gcompute_disk_type resource. - Reference to a disk type.
- Specifies the disk type to use to create the instance. - Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard. - If not specified, the default is pd-standard.
returned: success returned: success
@ -637,14 +635,14 @@ properties:
type: str type: str
source: source:
description: description:
- Reference to a gcompute_disk resource. When creating a new instance, one - Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
of initializeParams.sourceImage or disks.source is required. or disks.source is required.
- If desired, you can also attach existing non-root persistent disks using - If desired, you can also attach existing non-root persistent disks using
this property. This field is only applicable for persistent disks. this property. This field is only applicable for persistent disks.
- Note that for InstanceTemplate, specify the disk name, not the URL for - Note that for InstanceTemplate, specify the disk name, not the URL for
the disk. the disk.
returned: success returned: success
type: dict type: str
type: type:
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,
@ -653,7 +651,7 @@ properties:
type: str type: str
machineType: machineType:
description: description:
- Reference to a gcompute_machine_type resource. - The machine type to use in the VM instance template.
returned: success returned: success
type: str type: str
minCpuPlatform: minCpuPlatform:
@ -710,14 +708,14 @@ properties:
type: str type: str
natIP: natIP:
description: description:
- Specifies the title of a gcompute_address. - Reference to an address.
- An external IP address associated with this instance. - An external IP address associated with this instance.
- Specify an unused static external IP address available to the project - Specify an unused static external IP address available to the project
or leave this field undefined to use an IP from a shared ephemeral or leave this field undefined to use an IP from a shared ephemeral
IP address pool. If you specify a static external IP address, it must IP address pool. If you specify a static external IP address, it must
live in the same region as the zone of the instance. live in the same region as the zone of the instance.
returned: success returned: success
type: dict type: str
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.
@ -754,12 +752,12 @@ properties:
type: str type: str
network: network:
description: description:
- Specifies the title of an existing gcompute_network. When creating an - Specifies the title of an existing network. When creating an instance,
instance, if neither the network nor the subnetwork is specified, the if neither the network nor the subnetwork is specified, the default network
default network global/networks/default is used; if the network is not global/networks/default is used; if the network is not specified but the
specified but the subnetwork is specified, the network is inferred. subnetwork is specified, the network is inferred.
returned: success returned: success
type: dict type: str
networkIP: networkIP:
description: description:
- An IPv4 internal network address to assign to the instance for this network - An IPv4 internal network address to assign to the instance for this network
@ -769,12 +767,12 @@ properties:
type: str type: str
subnetwork: subnetwork:
description: description:
- Reference to a gcompute_subnetwork resource. - Reference to a VPC network.
- If the network resource is in legacy mode, do not provide this property. - If the network resource is in legacy mode, do not provide this property.
If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in auto subnet mode, providing the subnetwork is optional.
If the network is in custom subnet mode, then this field should be specified. If the network is in custom subnet mode, then this field should be specified.
returned: success returned: success
type: dict type: str
scheduling: scheduling:
description: description:
- Sets the scheduling options for this instance. - Sets the scheduling options for this instance.
@ -894,7 +892,7 @@ def main():
)), )),
interface=dict(type='str', choices=['SCSI', 'NVME']), interface=dict(type='str', choices=['SCSI', 'NVME']),
mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']), mode=dict(type='str', choices=['READ_WRITE', 'READ_ONLY']),
source=dict(type='dict'), source=dict(),
type=dict(type='str', choices=['SCRATCH', 'PERSISTENT']) type=dict(type='str', choices=['SCRATCH', 'PERSISTENT'])
)), )),
machine_type=dict(required=True, type='str'), machine_type=dict(required=True, type='str'),
@ -907,7 +905,7 @@ def main():
network_interfaces=dict(type='list', elements='dict', options=dict( network_interfaces=dict(type='list', elements='dict', options=dict(
access_configs=dict(type='list', elements='dict', options=dict( access_configs=dict(type='list', elements='dict', options=dict(
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
nat_ip=dict(type='dict'), nat_ip=dict(),
type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT']) type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])
)), )),
alias_ip_ranges=dict(type='list', elements='dict', options=dict( alias_ip_ranges=dict(type='list', elements='dict', options=dict(
@ -915,9 +913,9 @@ def main():
subnetwork_range_name=dict(type='str') subnetwork_range_name=dict(type='str')
)), )),
name=dict(type='str'), name=dict(type='str'),
network=dict(type='dict'), network=dict(),
network_ip=dict(type='str'), network_ip=dict(type='str'),
subnetwork=dict(type='dict') subnetwork=dict()
)), )),
scheduling=dict(type='dict', options=dict( scheduling=dict(type='dict', options=dict(
automatic_restart=dict(type='bool'), automatic_restart=dict(type='bool'),
@ -1120,7 +1118,7 @@ def decode_response(response, module):
return response return response
# TODO(alexstephen): Implement updating metadata on exsiting resources. # TODO(alexstephen): Implement updating metadata on existing resources.
# Expose instance 'metadata' as a simple name/value pair hash. However the API # Expose instance 'metadata' as a simple name/value pair hash. However the API
# defines metadata as a NestedObject with the following layout: # defines metadata as a NestedObject with the following layout:

View file

@ -190,7 +190,7 @@ items:
type: int type: int
diskType: diskType:
description: description:
- Reference to a gcompute_disk_type resource. - Reference to a disk type.
- Specifies the disk type to use to create the instance. - Specifies the disk type to use to create the instance.
- If not specified, the default is pd-standard. - If not specified, the default is pd-standard.
returned: success returned: success
@ -243,15 +243,15 @@ items:
type: str type: str
source: source:
description: description:
- Reference to a gcompute_disk resource. When creating a new instance, - Reference to a disk. When creating a new instance, one of initializeParams.sourceImage
one of initializeParams.sourceImage or disks.source is required. or disks.source is required.
- If desired, you can also attach existing non-root persistent disks - If desired, you can also attach existing non-root persistent disks
using this property. This field is only applicable for persistent using this property. This field is only applicable for persistent
disks. disks.
- Note that for InstanceTemplate, specify the disk name, not the URL - Note that for InstanceTemplate, specify the disk name, not the URL
for the disk. for the disk.
returned: success returned: success
type: dict type: str
type: type:
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
@ -260,7 +260,7 @@ items:
type: str type: str
machineType: machineType:
description: description:
- Reference to a gcompute_machine_type resource. - The machine type to use in the VM instance template.
returned: success returned: success
type: str type: str
minCpuPlatform: minCpuPlatform:
@ -320,14 +320,14 @@ items:
type: str type: str
natIP: natIP:
description: description:
- Specifies the title of a gcompute_address. - Reference to an address.
- An external IP address associated with this instance. - An external IP address associated with this instance.
- Specify an unused static external IP address available to the - Specify an unused static external IP address available to the
project or leave this field undefined to use an IP from a shared project or leave this field undefined to use an IP from a shared
ephemeral IP address pool. If you specify a static external IP ephemeral IP address pool. If you specify a static external IP
address, it must live in the same region as the zone of the instance. address, it must live in the same region as the zone of the instance.
returned: success returned: success
type: dict type: str
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.
@ -366,12 +366,12 @@ items:
type: str type: str
network: network:
description: description:
- Specifies the title of an existing gcompute_network. When creating - Specifies the title of an existing network. When creating an instance,
an instance, if neither the network nor the subnetwork is specified, if neither the network nor the subnetwork is specified, the default
the default network global/networks/default is used; if the network network global/networks/default is used; if the network is not specified
is not specified but the subnetwork is specified, the network is inferred. but the subnetwork is specified, the network is inferred.
returned: success returned: success
type: dict type: str
networkIP: networkIP:
description: description:
- An IPv4 internal network address to assign to the instance for this - An IPv4 internal network address to assign to the instance for this
@ -381,13 +381,13 @@ items:
type: str type: str
subnetwork: subnetwork:
description: description:
- Reference to a gcompute_subnetwork resource. - Reference to a VPC network.
- If the network resource is in legacy mode, do not provide this property. - If the network resource is in legacy mode, do not provide this property.
If the network is in auto subnet mode, providing the subnetwork is If the network is in auto subnet mode, providing the subnetwork is
optional. If the network is in custom subnet mode, then this field optional. If the network is in custom subnet mode, then this field
should be specified. should be specified.
returned: success returned: success
type: dict type: str
scheduling: scheduling:
description: description:
- Sets the scheduling options for this instance. - Sets the scheduling options for this instance.

View file

@ -90,7 +90,7 @@ items:
type: str type: str
description: description:
description: description:
- An optional description of this resource. . - An optional description of this resource.
returned: success returned: success
type: str type: str
privateInterconnectInfo: privateInterconnectInfo:
@ -119,7 +119,7 @@ items:
will automatically connect the Interconnect to the network & region within will automatically connect the Interconnect to the network & region within
which the Cloud Router is configured. which the Cloud Router is configured.
returned: success returned: success
type: dict type: str
creationTimestamp: creationTimestamp:
description: description:
- Creation timestamp in RFC3339 text format. - Creation timestamp in RFC3339 text format.

View file

@ -129,10 +129,9 @@ options:
- The source snapshot used to create this disk. You can provide this as a partial - The source snapshot used to create this disk. You can provide this as a partial
or full URL to the resource. or full URL to the resource.
- 'This field represents a link to a Snapshot resource in GCP. It can be specified - 'This field represents a link to a Snapshot resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_snapshot in two ways. First, you can place in the selfLink of the resource here as a
task and then set this source_snapshot field to "{{ name-of-resource }}" Alternatively, string Alternatively, you can add `register: name-of-resource` to a gcp_compute_snapshot
you can set this source_snapshot to a dictionary with the selfLink key where task and then set this source_snapshot field to "{{ name-of-resource }}"'
the value is the selfLink of your Snapshot'
required: false required: false
source_snapshot_encryption_key: source_snapshot_encryption_key:
description: description:
@ -165,8 +164,8 @@ EXAMPLES = '''
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- us-central1-a - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
- us-central1-f - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
project: "test_project" project: "test_project"
auth_kind: "serviceaccount" auth_kind: "serviceaccount"
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
@ -288,7 +287,7 @@ sourceSnapshot:
- The source snapshot used to create this disk. You can provide this as a partial - The source snapshot used to create this disk. You can provide this as a partial
or full URL to the resource. or full URL to the resource.
returned: success returned: success
type: dict type: str
sourceSnapshotEncryptionKey: sourceSnapshotEncryptionKey:
description: description:
- The customer-supplied encryption key of the source snapshot. Required if the source - The customer-supplied encryption key of the source snapshot. Required if the source
@ -351,7 +350,7 @@ def main():
raw_key=dict(type='str'), raw_key=dict(type='str'),
sha256=dict(type='str') sha256=dict(type='str')
)), )),
source_snapshot=dict(type='dict'), source_snapshot=dict(),
source_snapshot_encryption_key=dict(type='dict', options=dict( source_snapshot_encryption_key=dict(type='dict', options=dict(
raw_key=dict(type='str'), raw_key=dict(type='str'),
sha256=dict(type='str') sha256=dict(type='str')

View file

@ -185,7 +185,7 @@ items:
- The source snapshot used to create this disk. You can provide this as a partial - The source snapshot used to create this disk. You can provide this as a partial
or full URL to the resource. or full URL to the resource.
returned: success returned: success
type: dict type: str
sourceSnapshotEncryptionKey: sourceSnapshotEncryptionKey:
description: description:
- The customer-supplied encryption key of the source snapshot. Required if the - The customer-supplied encryption key of the source snapshot. Required if the

View file

@ -87,10 +87,9 @@ options:
description: description:
- The network that this route applies to. - The network that this route applies to.
- 'This field represents a link to a Network resource in GCP. It can be specified - 'This field represents a link to a Network resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_network in two ways. First, you can place in the selfLink of the resource here as a
task and then set this network field to "{{ name-of-resource }}" Alternatively, string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network
you can set this network to a dictionary with the selfLink key where the value task and then set this network field to "{{ name-of-resource }}"'
is the selfLink of your Network'
required: true required: true
priority: priority:
description: description:
@ -118,6 +117,10 @@ options:
- 'You can specify this as a full or partial URL. For example: * U(https://www.googleapis.com/compute/v1/projects/project/zones/zone/) - 'You can specify this as a full or partial URL. For example: * U(https://www.googleapis.com/compute/v1/projects/project/zones/zone/)
instances/instance * projects/project/zones/zone/instances/instance * zones/zone/instances/instance instances/instance * projects/project/zones/zone/instances/instance * zones/zone/instances/instance
.' .'
- 'This field represents a link to a Instance resource in GCP. It can be specified
in two ways. First, you can place in the selfLink of the resource here as a
string Alternatively, you can add `register: name-of-resource` to a gcp_compute_instance
task and then set this next_hop_instance field to "{{ name-of-resource }}"'
required: false required: false
next_hop_ip: next_hop_ip:
description: description:
@ -126,6 +129,10 @@ options:
next_hop_vpn_tunnel: next_hop_vpn_tunnel:
description: description:
- URL to a VpnTunnel that should handle matching packets. - URL to a VpnTunnel that should handle matching packets.
- 'This field represents a link to a VpnTunnel resource in GCP. It can be specified
in two ways. First, you can place in the selfLink of the resource here as a
string Alternatively, you can add `register: name-of-resource` to a gcp_compute_vpn_tunnel
task and then set this next_hop_vpn_tunnel field to "{{ name-of-resource }}"'
required: false required: false
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
@ -185,7 +192,7 @@ network:
description: description:
- The network that this route applies to. - The network that this route applies to.
returned: success returned: success
type: dict type: str
priority: priority:
description: description:
- The priority of this route. Priority is used to break ties in cases where there - The priority of this route. Priority is used to break ties in cases where there
@ -256,13 +263,13 @@ def main():
dest_range=dict(required=True, type='str'), dest_range=dict(required=True, type='str'),
description=dict(type='str'), description=dict(type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
network=dict(required=True, type='dict'), network=dict(required=True),
priority=dict(type='int'), priority=dict(type='int'),
tags=dict(type='list', elements='str'), tags=dict(type='list', elements='str'),
next_hop_gateway=dict(type='str'), next_hop_gateway=dict(type='str'),
next_hop_instance=dict(type='str'), next_hop_instance=dict(),
next_hop_ip=dict(type='str'), next_hop_ip=dict(type='str'),
next_hop_vpn_tunnel=dict(type='str') next_hop_vpn_tunnel=dict()
) )
) )
@ -321,9 +328,9 @@ def resource_to_request(module):
u'priority': module.params.get('priority'), u'priority': module.params.get('priority'),
u'tags': module.params.get('tags'), u'tags': module.params.get('tags'),
u'nextHopGateway': module.params.get('next_hop_gateway'), u'nextHopGateway': module.params.get('next_hop_gateway'),
u'nextHopInstance': module.params.get('next_hop_instance'), u'nextHopInstance': replace_resource_dict(module.params.get(u'next_hop_instance', {}), 'selfLink'),
u'nextHopIp': module.params.get('next_hop_ip'), u'nextHopIp': module.params.get('next_hop_ip'),
u'nextHopVpnTunnel': module.params.get('next_hop_vpn_tunnel') u'nextHopVpnTunnel': replace_resource_dict(module.params.get(u'next_hop_vpn_tunnel', {}), 'selfLink')
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -396,9 +403,9 @@ def response_to_hash(module, response):
u'priority': module.params.get('priority'), u'priority': module.params.get('priority'),
u'tags': module.params.get('tags'), u'tags': module.params.get('tags'),
u'nextHopGateway': module.params.get('next_hop_gateway'), u'nextHopGateway': module.params.get('next_hop_gateway'),
u'nextHopInstance': module.params.get('next_hop_instance'), u'nextHopInstance': replace_resource_dict(module.params.get(u'next_hop_instance', {}), 'selfLink'),
u'nextHopIp': module.params.get('next_hop_ip'), u'nextHopIp': module.params.get('next_hop_ip'),
u'nextHopVpnTunnel': module.params.get('next_hop_vpn_tunnel'), u'nextHopVpnTunnel': replace_resource_dict(module.params.get(u'next_hop_vpn_tunnel', {}), 'selfLink'),
u'nextHopNetwork': response.get(u'nextHopNetwork') u'nextHopNetwork': response.get(u'nextHopNetwork')
} }

View file

@ -91,7 +91,7 @@ items:
description: description:
- The network that this route applies to. - The network that this route applies to.
returned: success returned: success
type: dict type: str
priority: priority:
description: description:
- The priority of this route. Priority is used to break ties in cases where - The priority of this route. Priority is used to break ties in cases where

View file

@ -64,10 +64,9 @@ options:
description: description:
- A reference to the network to which this router belongs. - A reference to the network to which this router belongs.
- 'This field represents a link to a Network resource in GCP. It can be specified - 'This field represents a link to a Network resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_network in two ways. First, you can place in the selfLink of the resource here as a
task and then set this network field to "{{ name-of-resource }}" Alternatively, string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network
you can set this network to a dictionary with the selfLink key where the value task and then set this network field to "{{ name-of-resource }}"'
is the selfLink of your Network'
required: true required: true
bgp: bgp:
description: description:
@ -183,7 +182,7 @@ network:
description: description:
- A reference to the network to which this router belongs. - A reference to the network to which this router belongs.
returned: success returned: success
type: dict type: str
bgp: bgp:
description: description:
- BGP information specific to this router. - BGP information specific to this router.
@ -260,7 +259,7 @@ def main():
state=dict(default='present', choices=['present', 'absent'], type='str'), state=dict(default='present', choices=['present', 'absent'], type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
description=dict(type='str'), description=dict(type='str'),
network=dict(required=True, type='dict'), network=dict(required=True),
bgp=dict(type='dict', options=dict( bgp=dict(type='dict', options=dict(
asn=dict(required=True, type='int'), asn=dict(required=True, type='int'),
advertise_mode=dict(default='DEFAULT', type='str', choices=['DEFAULT', 'CUSTOM']), advertise_mode=dict(default='DEFAULT', type='str', choices=['DEFAULT', 'CUSTOM']),

View file

@ -98,7 +98,7 @@ items:
description: description:
- A reference to the network to which this router belongs. - A reference to the network to which this router belongs.
returned: success returned: success
type: dict type: str
bgp: bgp:
description: description:
- BGP information specific to this router. - BGP information specific to this router.

View file

@ -90,10 +90,9 @@ options:
- The network this subnet belongs to. - The network this subnet belongs to.
- Only networks that are in the distributed mode can have subnetworks. - Only networks that are in the distributed mode can have subnetworks.
- 'This field represents a link to a Network resource in GCP. It can be specified - 'This field represents a link to a Network resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_network in two ways. First, you can place in the selfLink of the resource here as a
task and then set this network field to "{{ name-of-resource }}" Alternatively, string Alternatively, you can add `register: name-of-resource` to a gcp_compute_network
you can set this network to a dictionary with the selfLink key where the value task and then set this network field to "{{ name-of-resource }}"'
is the selfLink of your Network'
required: true required: true
enable_flow_logs: enable_flow_logs:
description: description:
@ -208,7 +207,7 @@ network:
- The network this subnet belongs to. - The network this subnet belongs to.
- Only networks that are in the distributed mode can have subnetworks. - Only networks that are in the distributed mode can have subnetworks.
returned: success returned: success
type: dict type: str
enableFlowLogs: enableFlowLogs:
description: description:
- Whether to enable flow logging for this subnetwork. - Whether to enable flow logging for this subnetwork.
@ -278,7 +277,7 @@ def main():
description=dict(type='str'), description=dict(type='str'),
ip_cidr_range=dict(required=True, type='str'), ip_cidr_range=dict(required=True, type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
network=dict(required=True, type='dict'), network=dict(required=True),
enable_flow_logs=dict(type='bool'), enable_flow_logs=dict(type='bool'),
secondary_ip_ranges=dict(type='list', elements='dict', options=dict( secondary_ip_ranges=dict(type='list', elements='dict', options=dict(
range_name=dict(required=True, type='str'), range_name=dict(required=True, type='str'),

View file

@ -115,7 +115,7 @@ items:
- The network this subnet belongs to. - The network this subnet belongs to.
- Only networks that are in the distributed mode can have subnetworks. - Only networks that are in the distributed mode can have subnetworks.
returned: success returned: success
type: dict type: str
enableFlowLogs: enableFlowLogs:
description: description:
- Whether to enable flow logging for this subnetwork. - Whether to enable flow logging for this subnetwork.

View file

@ -67,10 +67,9 @@ options:
- A reference to the UrlMap resource that defines the mapping from URL to the - A reference to the UrlMap resource that defines the mapping from URL to the
BackendService. BackendService.
- 'This field represents a link to a UrlMap resource in GCP. It can be specified - 'This field represents a link to a UrlMap resource in GCP. It can be specified
in two ways. You can add `register: name-of-resource` to a gcp_compute_url_map in two ways. First, you can place in the selfLink of the resource here as a
task and then set this url_map field to "{{ name-of-resource }}" Alternatively, string Alternatively, you can add `register: name-of-resource` to a gcp_compute_url_map
you can set this url_map to a dictionary with the selfLink key where the value task and then set this url_map field to "{{ name-of-resource }}"'
is the selfLink of your UrlMap'
required: true required: true
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
@ -166,7 +165,7 @@ urlMap:
description: description:
- A reference to the UrlMap resource that defines the mapping from URL to the BackendService. - A reference to the UrlMap resource that defines the mapping from URL to the BackendService.
returned: success returned: success
type: dict type: str
''' '''
################################################################################ ################################################################################
@ -190,7 +189,7 @@ def main():
state=dict(default='present', choices=['present', 'absent'], type='str'), state=dict(default='present', choices=['present', 'absent'], type='str'),
description=dict(type='str'), description=dict(type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
url_map=dict(required=True, type='dict') url_map=dict(required=True)
) )
) )

View file

@ -211,6 +211,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: "address-instance" name: "address-instance"
@ -220,6 +221,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: address register: address
ignore_errors: true
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: "network-instance"
@ -228,6 +230,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: network register: network
ignore_errors: true
- name: delete a disk - name: delete a disk
gcp_compute_disk: gcp_compute_disk:
name: "disk-instance" name: "disk-instance"
@ -239,3 +242,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: disk register: disk
ignore_errors: true

View file

@ -141,6 +141,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instancegroup" name: "network-instancegroup"
@ -149,3 +150,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: network register: network
ignore_errors: true

View file

@ -166,6 +166,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a instance template - name: delete a instance template
gcp_compute_instance_template: gcp_compute_instance_template:
name: "{{ resource_name }}" name: "{{ resource_name }}"
@ -187,6 +188,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: instancetemplate register: instancetemplate
ignore_errors: true
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: "address-instancetemplate" name: "address-instancetemplate"
@ -196,6 +198,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: address register: address
ignore_errors: true
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instancetemplate" name: "network-instancetemplate"
@ -204,3 +207,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: network register: network
ignore_errors: true

View file

@ -188,6 +188,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: "address-instancetemplate" name: "address-instancetemplate"
@ -197,6 +198,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: address register: address
ignore_errors: true
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instancetemplate" name: "network-instancetemplate"
@ -205,3 +207,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: network register: network
ignore_errors: true

View file

@ -21,8 +21,8 @@
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- us-central1-a - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
- us-central1-f - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
@ -36,8 +36,8 @@
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- us-central1-a - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
- us-central1-f - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
@ -72,8 +72,8 @@
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- us-central1-a - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
- us-central1-f - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
@ -93,8 +93,8 @@
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- us-central1-a - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
- us-central1-f - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
@ -129,8 +129,8 @@
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- us-central1-a - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
- us-central1-f - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"

View file

@ -144,6 +144,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-route" name: "network-route"
@ -152,3 +153,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: network register: network
ignore_errors: true

View file

@ -166,6 +166,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-router" name: "network-router"
@ -174,3 +175,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: network register: network
ignore_errors: true

View file

@ -132,6 +132,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-subnetwork" name: "network-subnetwork"
@ -141,3 +142,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: network register: network
ignore_errors: true

View file

@ -154,6 +154,7 @@
- result.has_key('kind') == False - result.has_key('kind') == False
#--------------------------------------------------------- #---------------------------------------------------------
# Post-test teardown # Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a url map - name: delete a url map
gcp_compute_url_map: gcp_compute_url_map:
name: "urlmap-targethttpproxy" name: "urlmap-targethttpproxy"
@ -163,6 +164,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: urlmap register: urlmap
ignore_errors: true
- name: delete a backend service - name: delete a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-targethttpproxy" name: "backendservice-targethttpproxy"
@ -176,6 +178,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: backendservice register: backendservice
ignore_errors: true
- name: delete a http health check - name: delete a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:
name: "httphealthcheck-targethttpproxy" name: "httphealthcheck-targethttpproxy"
@ -188,6 +191,7 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: healthcheck register: healthcheck
ignore_errors: true
- name: delete a instance group - name: delete a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-targethttpproxy" name: "instancegroup-targethttpproxy"
@ -197,3 +201,4 @@
service_account_file: "{{ gcp_cred_file }}" service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: instancegroup register: instancegroup
ignore_errors: true