remove min_version from a bunch of fields that are in GA now

This commit is contained in:
Dana Hoffman 2018-10-04 03:11:37 +00:00 committed by Alex Stephen
parent 91dcd0d6f5
commit f1a96adf23
111 changed files with 3604 additions and 3448 deletions

View file

@ -62,6 +62,14 @@ options:
letter, and all following characters must be a dash, lowercase letter, or digit, letter, and all following characters must be a dash, lowercase letter, or digit,
except the last character, which cannot be a dash. except the last character, which cannot be a dash.
required: true required: true
network_tier:
description:
- 'The networking tier used for configuring this address. This field can take the
following values: PREMIUM or STANDARD. If this field is not specified, it is assumed
to be PREMIUM.'
required: false
version_added: 2.8
choices: ['PREMIUM', 'STANDARD']
subnetwork: subnetwork:
description: description:
- The URL of the subnetwork in which to reserve the address. If an IP address is specified, - The URL of the subnetwork in which to reserve the address. If an IP address is specified,
@ -135,6 +143,13 @@ RETURN = '''
except the last character, which cannot be a dash. except the last character, which cannot be a dash.
returned: success returned: success
type: str type: str
networkTier:
description:
- 'The networking tier used for configuring this address. This field can take the
following values: PREMIUM or STANDARD. If this field is not specified, it is assumed
to be PREMIUM.'
returned: success
type: str
subnetwork: subnetwork:
description: description:
- The URL of the subnetwork in which to reserve the address. If an IP address is specified, - The URL of the subnetwork in which to reserve the address. If an IP address is specified,
@ -237,7 +252,7 @@ def resource_to_request(module):
u'description': module.params.get('description'), u'description': module.params.get('description'),
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'networkTier': module.params.get('network_tier'), u'networkTier': module.params.get('network_tier'),
u'subnetwork': replace_resource_dict(module.params.get(u'subnetwork', {}), 'selfLink'), u'subnetwork': replace_resource_dict(module.params.get(u'subnetwork', {}), 'selfLink')
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():

View file

@ -107,6 +107,13 @@ items:
except the last character, which cannot be a dash. except the last character, which cannot be a dash.
returned: success returned: success
type: str type: str
networkTier:
description:
- 'The networking tier used for configuring this address. This field can take the
following values: PREMIUM or STANDARD. If this field is not specified, it is assumed
to be PREMIUM.'
returned: success
type: str
subnetwork: subnetwork:
description: description:
- The URL of the subnetwork in which to reserve the address. If an IP address is specified, - The URL of the subnetwork in which to reserve the address. If an IP address is specified,

View file

@ -123,6 +123,15 @@ options:
required: false required: false
version_added: 2.8 version_added: 2.8
choices: ['INGRESS', 'EGRESS'] choices: ['INGRESS', 'EGRESS']
disabled:
description:
- Denotes whether the firewall rule is disabled, i.e not applied to the network it
is associated with. When set to true, the firewall rule is not enforced and the
network behaves as if it did not exist. If this is unspecified, the firewall rule
will be enabled.
required: false
type: bool
version_added: 2.8
name: name:
description: description:
- Name of the resource. Provided by the client when the resource is created. The name - Name of the resource. Provided by the client when the resource is created. The name
@ -417,6 +426,14 @@ RETURN = '''
traffic, it is NOT supported to specify sourceRanges OR sourceTags.' traffic, it is NOT supported to specify sourceRanges OR sourceTags.'
returned: success returned: success
type: str type: str
disabled:
description:
- Denotes whether the firewall rule is disabled, i.e not applied to the network it
is associated with. When set to true, the firewall rule is not enforced and the
network behaves as if it did not exist. If this is unspecified, the firewall rule
will be enabled.
returned: success
type: bool
id: id:
description: description:
- The unique identifier for the resource. - The unique identifier for the resource.
@ -537,6 +554,7 @@ def main():
description=dict(type='str'), description=dict(type='str'),
destination_ranges=dict(type='list', elements='str'), destination_ranges=dict(type='list', elements='str'),
direction=dict(type='str', choices=['INGRESS', 'EGRESS']), direction=dict(type='str', choices=['INGRESS', 'EGRESS']),
disabled=dict(type='bool'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
network=dict(required=True, type='dict'), network=dict(required=True, type='dict'),
priority=dict(default=1000, type='int'), priority=dict(default=1000, type='int'),
@ -602,6 +620,7 @@ def resource_to_request(module):
u'description': module.params.get('description'), u'description': module.params.get('description'),
u'destinationRanges': module.params.get('destination_ranges'), u'destinationRanges': module.params.get('destination_ranges'),
u'direction': module.params.get('direction'), u'direction': module.params.get('direction'),
u'disabled': module.params.get('disabled'),
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'), u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'),
u'priority': module.params.get('priority'), u'priority': module.params.get('priority'),
@ -682,6 +701,7 @@ def response_to_hash(module, response):
u'description': response.get(u'description'), u'description': response.get(u'description'),
u'destinationRanges': response.get(u'destinationRanges'), u'destinationRanges': response.get(u'destinationRanges'),
u'direction': response.get(u'direction'), u'direction': response.get(u'direction'),
u'disabled': response.get(u'disabled'),
u'id': response.get(u'id'), u'id': response.get(u'id'),
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'network': response.get(u'network'), u'network': response.get(u'network'),

View file

@ -133,6 +133,14 @@ items:
traffic, it is NOT supported to specify sourceRanges OR sourceTags.' traffic, it is NOT supported to specify sourceRanges OR sourceTags.'
returned: success returned: success
type: str type: str
disabled:
description:
- Denotes whether the firewall rule is disabled, i.e not applied to the network it
is associated with. When set to true, the firewall rule is not enforced and the
network behaves as if it did not exist. If this is unspecified, the firewall rule
will be enabled.
returned: success
type: bool
id: id:
description: description:
- The unique identifier for the resource. - The unique identifier for the resource.

View file

@ -172,6 +172,14 @@ options:
selfLink of your TargetPool.' selfLink of your TargetPool.'
required: false required: false
version_added: 2.7 version_added: 2.7
network_tier:
description:
- 'The networking tier used for configuring this address. This field can take the
following values: PREMIUM or STANDARD. If this field is not specified, it is assumed
to be PREMIUM.'
required: false
version_added: 2.8
choices: ['PREMIUM', 'STANDARD']
region: region:
description: description:
- A reference to the region where the regional forwarding rule resides. - A reference to the region where the regional forwarding rule resides.
@ -352,6 +360,13 @@ RETURN = '''
updates. updates.
returned: success returned: success
type: str type: str
networkTier:
description:
- 'The networking tier used for configuring this address. This field can take the
following values: PREMIUM or STANDARD. If this field is not specified, it is assumed
to be PREMIUM.'
returned: success
type: str
region: region:
description: description:
- A reference to the region where the regional forwarding rule resides. - A reference to the region where the regional forwarding rule resides.
@ -391,10 +406,8 @@ def main():
ports=dict(type='list', elements='str'), ports=dict(type='list', elements='str'),
subnetwork=dict(type='dict'), subnetwork=dict(type='dict'),
target=dict(type='dict'), target=dict(type='dict'),
all_ports=dict(type='bool'),
network_tier=dict(type='str', choices=['PREMIUM', 'STANDARD']), network_tier=dict(type='str', choices=['PREMIUM', 'STANDARD']),
service_label=dict(type='str'), region=dict(required=True, type='str')
region=dict(required=True, type='str'),
) )
) )
@ -491,9 +504,7 @@ def resource_to_request(module):
u'ports': module.params.get('ports'), u'ports': module.params.get('ports'),
u'subnetwork': replace_resource_dict(module.params.get(u'subnetwork', {}), 'selfLink'), u'subnetwork': replace_resource_dict(module.params.get(u'subnetwork', {}), 'selfLink'),
u'target': replace_resource_dict(module.params.get(u'target', {}), 'selfLink'), u'target': replace_resource_dict(module.params.get(u'target', {}), 'selfLink'),
u'allPorts': module.params.get('all_ports'), u'networkTier': module.params.get('network_tier')
u'networkTier': module.params.get('network_tier'),
u'serviceLabel': module.params.get('service_label'),
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -573,7 +584,8 @@ def response_to_hash(module, response):
u'ports': response.get(u'ports'), u'ports': response.get(u'ports'),
u'subnetwork': response.get(u'subnetwork'), u'subnetwork': response.get(u'subnetwork'),
u'target': response.get(u'target'), u'target': response.get(u'target'),
u'labelFingerprint': response.get(u'labelFingerprint') u'labelFingerprint': response.get(u'labelFingerprint'),
u'networkTier': module.params.get('network_tier')
} }

View file

@ -203,6 +203,13 @@ items:
updates. updates.
returned: success returned: success
type: str type: str
networkTier:
description:
- 'The networking tier used for configuring this address. This field can take the
following values: PREMIUM or STANDARD. If this field is not specified, it is assumed
to be PREMIUM.'
returned: success
type: str
region: region:
description: description:
- A reference to the region where the regional forwarding rule resides. - A reference to the region where the regional forwarding rule resides.

View file

@ -42,38 +42,26 @@ requirements:
- google-auth >= 1.3.0 - google-auth >= 1.3.0
options: options:
state: state:
description:
- Whether the given object should exist in GCP
choices:
- present
- absent
default: present
address:
description:
- The static external IP address represented by this resource.
required: false
version_added: 2.8
description: description:
description: description:
- An optional description of this resource. - An optional description of this resource.
- Provide this property when you create the resource.
required: false required: false
name: name:
description: description:
- Name of the resource. Provided by the client when the resource is created. The - Name of the resource. Provided by the client when the resource is created. The name
name must be 1-63 characters long, and comply with RFC1035. Specifically, the must be 1-63 characters long, and comply with RFC1035. Specifically, the name must
name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
which means the first character must be a lowercase letter, and all following which means the first character must be a lowercase letter, and all following characters
characters must be a dash, lowercase letter, or digit, except the last character, must be a dash, lowercase letter, or digit, except the last character, which cannot
which cannot be a dash. be a dash.
required: true required: true
ip_version: ip_version:
description: description:
- The IP Version that will be used by this address. Valid options are `IPV4` or - The IP Version that will be used by this address. Valid options are IPV4 or IPV6.
`IPV6`. The default value is `IPV4`. The default value is IPV4.
required: false required: false
choices: choices: ['IPV4', 'IPV6']
- IPV4
- IPV6
address_type: address_type:
description: description:
- The type of the address to reserve, default is EXTERNAL. - The type of the address to reserve, default is EXTERNAL.
@ -82,9 +70,7 @@ options:
required: false required: false
default: EXTERNAL default: EXTERNAL
version_added: 2.8 version_added: 2.8
choices: choices: ['EXTERNAL', 'INTERNAL']
- EXTERNAL
- INTERNAL
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/globalAddresses)' - 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/globalAddresses)'
@ -150,6 +136,13 @@ RETURN = '''
- A reference to the region where the regional address resides. - A reference to the region where the regional address resides.
returned: success returned: success
type: str type: str
addressType:
description:
- The type of the address to reserve, default is EXTERNAL.
- "* EXTERNAL indicates public/external single IP address."
- "* INTERNAL indicates internal IP ranges belonging to some network."
returned: success
type: str
''' '''
################################################################################ ################################################################################
@ -176,7 +169,7 @@ def main():
description=dict(type='str'), description=dict(type='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
ip_version=dict(type='str', choices=['IPV4', 'IPV6']), ip_version=dict(type='str', choices=['IPV4', 'IPV6']),
address_type=dict(default='EXTERNAL', type='str', choices=['EXTERNAL', 'INTERNAL']), address_type=dict(default='EXTERNAL', type='str', choices=['EXTERNAL', 'INTERNAL'])
) )
) )
@ -251,7 +244,7 @@ def resource_to_request(module):
u'description': module.params.get('description'), u'description': module.params.get('description'),
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'ipVersion': module.params.get('ip_version'), u'ipVersion': module.params.get('ip_version'),
u'addressType': module.params.get('address_type'), u'addressType': module.params.get('address_type')
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
@ -325,7 +318,7 @@ def response_to_hash(module, response):
u'labelFingerprint': response.get(u'labelFingerprint'), u'labelFingerprint': response.get(u'labelFingerprint'),
u'ipVersion': response.get(u'ipVersion'), u'ipVersion': response.get(u'ipVersion'),
u'region': response.get(u'region'), u'region': response.get(u'region'),
u'addressType': response.get(u'addressType'), u'addressType': response.get(u'addressType')
} }

View file

@ -112,6 +112,13 @@ items:
- A reference to the region where the regional address resides. - A reference to the region where the regional address resides.
returned: success returned: success
type: str type: str
addressType:
description:
- The type of the address to reserve, default is EXTERNAL.
- "* EXTERNAL indicates public/external single IP address."
- "* INTERNAL indicates internal IP ranges belonging to some network."
returned: success
type: str
''' '''
################################################################################ ################################################################################

View file

@ -18,14 +18,15 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
################################################################################ ################################################################################
# Documentation # Documentation
################################################################################ ################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'} ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ["preview"],
'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
@ -53,10 +54,8 @@ options:
state: state:
description: description:
- Whether the given object should exist in GCP - Whether the given object should exist in GCP
choices: choices: ['present', 'absent']
- present default: 'present'
- absent
default: present
description: description:
description: description:
- An optional description of this resource. Provide this property when you create - An optional description of this resource. Provide this property when you create
@ -72,29 +71,20 @@ options:
required: false required: false
name: name:
description: description:
- Name of the resource. Provided by the client when the resource is created. The - Name of the resource. Provided by the client when the resource is created. The name
name must be 1-63 characters long, and comply with RFC1035. Specifically, the must be 1-63 characters long, and comply with RFC1035. Specifically, the name must
name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
which means the first character must be a lowercase letter, and all following which means the first character must be a lowercase letter, and all following characters
characters must be a dash, lowercase letter, or digit, except the last character, must be a dash, lowercase letter, or digit, except the last character, which cannot
which cannot be a dash. be a dash.
required: true required: true
size_gb: size_gb:
description: description:
- Size of the persistent disk, specified in GB. You can specify this field when - Size of the persistent disk, specified in GB. You can specify this field when creating
creating a persistent disk using the sourceImage or sourceSnapshot parameter, a persistent disk using the sourceImage or sourceSnapshot parameter, or specify
or specify it alone to create an empty persistent disk. it alone to create an empty persistent disk.
- If you specify this field along with sourceImage or sourceSnapshot, the value - If you specify this field along with sourceImage or sourceSnapshot, the value of
of sizeGb must not be less than the size of the sourceImage or the size of the sizeGb must not be less than the size of the sourceImage or the size of the snapshot.
snapshot.
required: false
physical_block_size_bytes:
description:
- Physical block size of the persistent disk, in bytes. If not present in a request,
a default value is used. Currently supported sizes are 4096 and 16384, other
sizes may be added in the future.
- If an unsupported value is requested, the error message will list the supported
values for the caller's project.
required: false required: false
replica_zones: replica_zones:
description: description:
@ -102,8 +92,8 @@ options:
required: true required: true
type: type:
description: description:
- URL of the disk type resource describing which disk type to use to create the - URL of the disk type resource describing which disk type to use to create the disk.
disk. Provide this when creating the disk. Provide this when creating the disk.
required: false required: false
region: region:
description: description:
@ -112,60 +102,72 @@ options:
disk_encryption_key: disk_encryption_key:
description: description:
- Encrypts the disk using a customer-supplied encryption key. - Encrypts the disk using a customer-supplied encryption key.
- After you encrypt a disk with a customer-supplied key, you must provide the - After you encrypt a disk with a customer-supplied key, you must provide the same
same key if you use the disk later (e.g. to create a disk snapshot or an image, key if you use the disk later (e.g. to create a disk snapshot or an image, or to
or to attach the disk to a virtual machine). attach the disk to a virtual machine).
- Customer-supplied encryption keys do not protect access to metadata of the disk. - Customer-supplied encryption keys do not protect access to metadata of the disk.
- If you do not provide an encryption key when creating the disk, then the disk - If you do not provide an encryption key when creating the disk, then the disk will
will be encrypted using an automatically generated key and you do not need to be encrypted using an automatically generated key and you do not need to provide
provide a key to use the disk later. a key to use the disk later.
required: false required: false
suboptions: suboptions:
raw_key: raw_key:
description: description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64
base64 to either encrypt or decrypt this resource. to either encrypt or decrypt this resource.
required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key
that protects this resource.
required: false required: false
source_snapshot: source_snapshot:
description: description:
- 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
or full URL to the resource. full URL to the resource. For example, the following are valid values: *
`U(https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot`)
* `projects/project/global/snapshots/snapshot` * `global/snapshots/snapshot` .'
- '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. First, you can place a dictionary with key ''selfLink'' and value in two ways. You can add `register: name-of-resource` to a gcp_compute_snapshot
of your resource''s selfLink Alternatively, you can add `register: name-of-resource` task and then set this source_snapshot field to "{{ name-of-resource }}" Alternatively,
to a gcp_compute_snapshot task and then set this source_snapshot field to "{{ you can set this source_snapshot to a dictionary with the selfLink key where the
name-of-resource }}"' value is the selfLink of your Snapshot.'
required: false required: false
source_snapshot_encryption_key: source_snapshot_encryption_key:
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 source
source snapshot is protected by a customer-supplied encryption key. snapshot is protected by a customer-supplied encryption key.
required: false required: false
suboptions: suboptions:
raw_key: raw_key:
description: description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64
base64 to either encrypt or decrypt this resource. to either encrypt or decrypt this resource.
required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key
that protects this resource.
required: false required: false
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/beta/regionDisks)' - "API Reference: U(https://cloud.google.com/compute/docs/reference/rest/beta/regionDisks)"
- 'Adding or Resizing Regional Persistent Disks: U(https://cloud.google.com/compute/docs/disks/regional-persistent-disk)' - "Adding or Resizing Regional Persistent Disks: U(https://cloud.google.com/compute/docs/disks/regional-persistent-disk)"
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: create a region disk - name: create a region disk
gcp_compute_region_disk: gcp_compute_region_disk:
name: test_object name: "test_object"
size_gb: 50 size_gb: 50
disk_encryption_key: disk_encryption_key:
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - us-central1-a
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - us-central1-f
project: test_project project: "test_project"
auth_kind: serviceaccount auth_kind: "serviceaccount"
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''
@ -173,8 +175,8 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
labelFingerprint: labelFingerprint:
description: description:
- The fingerprint used for optimistic locking of this resource. Used internally - The fingerprint used for optimistic locking of this resource. Used internally during
during updates. updates.
returned: success returned: success
type: str type: str
creationTimestamp: creationTimestamp:
@ -215,22 +217,21 @@ licenses:
type: list type: list
name: name:
description: description:
- Name of the resource. Provided by the client when the resource is created. The - Name of the resource. Provided by the client when the resource is created. The name
name must be 1-63 characters long, and comply with RFC1035. Specifically, the must be 1-63 characters long, and comply with RFC1035. Specifically, the name must
name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
which means the first character must be a lowercase letter, and all following which means the first character must be a lowercase letter, and all following characters
characters must be a dash, lowercase letter, or digit, except the last character, must be a dash, lowercase letter, or digit, except the last character, which cannot
which cannot be a dash. be a dash.
returned: success returned: success
type: str type: str
sizeGb: sizeGb:
description: description:
- Size of the persistent disk, specified in GB. You can specify this field when - Size of the persistent disk, specified in GB. You can specify this field when creating
creating a persistent disk using the sourceImage or sourceSnapshot parameter, a persistent disk using the sourceImage or sourceSnapshot parameter, or specify
or specify it alone to create an empty persistent disk. it alone to create an empty persistent disk.
- If you specify this field along with sourceImage or sourceSnapshot, the value - If you specify this field along with sourceImage or sourceSnapshot, the value of
of sizeGb must not be less than the size of the sourceImage or the size of the sizeGb must not be less than the size of the sourceImage or the size of the snapshot.
snapshot.
returned: success returned: success
type: int type: int
users: users:
@ -239,15 +240,6 @@ users:
.' .'
returned: success returned: success
type: list type: list
physicalBlockSizeBytes:
description:
- Physical block size of the persistent disk, in bytes. If not present in a request,
a default value is used. Currently supported sizes are 4096 and 16384, other sizes
may be added in the future.
- If an unsupported value is requested, the error message will list the supported
values for the caller's project.
returned: success
type: int
replicaZones: replicaZones:
description: description:
- URLs of the zones where the disk should be replicated to. - URLs of the zones where the disk should be replicated to.
@ -255,8 +247,8 @@ replicaZones:
type: list type: list
type: type:
description: description:
- URL of the disk type resource describing which disk type to use to create the - URL of the disk type resource describing which disk type to use to create the disk.
disk. Provide this when creating the disk. Provide this when creating the disk.
returned: success returned: success
type: str type: str
region: region:
@ -268,31 +260,33 @@ diskEncryptionKey:
description: description:
- Encrypts the disk using a customer-supplied encryption key. - Encrypts the disk using a customer-supplied encryption key.
- After you encrypt a disk with a customer-supplied key, you must provide the same - After you encrypt a disk with a customer-supplied key, you must provide the same
key if you use the disk later (e.g. to create a disk snapshot or an image, or key if you use the disk later (e.g. to create a disk snapshot or an image, or to
to attach the disk to a virtual machine). attach the disk to a virtual machine).
- Customer-supplied encryption keys do not protect access to metadata of the disk. - Customer-supplied encryption keys do not protect access to metadata of the disk.
- If you do not provide an encryption key when creating the disk, then the disk - If you do not provide an encryption key when creating the disk, then the disk will
will be encrypted using an automatically generated key and you do not need to be encrypted using an automatically generated key and you do not need to provide
provide a key to use the disk later. a key to use the disk later.
returned: success returned: success
type: complex type: complex
contains: contains:
rawKey: rawKey:
description: description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64
base64 to either encrypt or decrypt this resource. to either encrypt or decrypt this resource.
returned: success returned: success
type: str type: str
sha256: sha256:
description: description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key
key that protects this resource. that protects this resource.
returned: success returned: success
type: str type: str
sourceSnapshot: sourceSnapshot:
description: description:
- 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
or full URL to the resource. full URL to the resource. For example, the following are valid values: *
`U(https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot`)
* `projects/project/global/snapshots/snapshot` * `global/snapshots/snapshot` .'
returned: success returned: success
type: dict type: dict
sourceSnapshotEncryptionKey: sourceSnapshotEncryptionKey:
@ -304,23 +298,23 @@ sourceSnapshotEncryptionKey:
contains: contains:
rawKey: rawKey:
description: description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64
base64 to either encrypt or decrypt this resource. to either encrypt or decrypt this resource.
returned: success returned: success
type: str type: str
sha256: sha256:
description: description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key
key that protects this resource. that protects this resource.
returned: success returned: success
type: str type: str
sourceSnapshotId: sourceSnapshotId:
description: description:
- The unique ID of the snapshot used to create this disk. This value identifies - The unique ID of the snapshot used to create this disk. This value identifies the
the exact snapshot that was used to create this persistent disk. For example, exact snapshot that was used to create this persistent disk. For example, if you
if you created the persistent disk from a snapshot that was later deleted and created the persistent disk from a snapshot that was later deleted and recreated
recreated under the same name, the source snapshot ID would identify the exact under the same name, the source snapshot ID would identify the exact version of
version of the snapshot that was used. the snapshot that was used.
returned: success returned: success
type: str type: str
''' '''
@ -350,13 +344,18 @@ def main():
licenses=dict(type='list', elements='str'), licenses=dict(type='list', elements='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
size_gb=dict(type='int'), size_gb=dict(type='int'),
physical_block_size_bytes=dict(type='int'),
replica_zones=dict(required=True, type='list', elements='str'), replica_zones=dict(required=True, type='list', elements='str'),
type=dict(type='str'), type=dict(type='str'),
region=dict(required=True, type='str'), region=dict(required=True, type='str'),
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))), disk_encryption_key=dict(type='dict', options=dict(
raw_key=dict(type='str'),
sha256=dict(type='str')
)),
source_snapshot=dict(type='dict'), source_snapshot=dict(type='dict'),
source_snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))), source_snapshot_encryption_key=dict(type='dict', options=dict(
raw_key=dict(type='str'),
sha256=dict(type='str')
))
) )
) )
@ -397,7 +396,8 @@ def create(module, link, kind):
def update(module, link, kind, fetch): def update(module, link, kind, fetch):
update_fields(module, resource_to_request(module), response_to_hash(module, fetch)) update_fields(module, resource_to_request(module),
response_to_hash(module, fetch))
return fetch_resource(module, self_link(module), kind) return fetch_resource(module, self_link(module), kind)
@ -411,16 +411,27 @@ def update_fields(module, request, response):
def label_fingerprint_update(module, request, response): def label_fingerprint_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/disks/{name}/setLabels"]).format(**module.params), ''.join([
{u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')}, "https://www.googleapis.com/compute/v1/",
"projects/{project}/regions/{region}/disks/{name}/setLabels"
]).format(**module.params),
{
u'labelFingerprint': response.get('labelFingerprint'),
u'labels': module.params.get('labels')
}
) )
def size_gb_update(module, request, response): def size_gb_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/disks/{name}/resize"]).format(**module.params), ''.join([
{u'sizeGb': module.params.get('size_gb')}, "https://www.googleapis.com/compute/v1/",
"projects/{project}/regions/{region}/disks/{name}/resize"
]).format(**module.params),
{
u'sizeGb': module.params.get('size_gb')
}
) )
@ -432,20 +443,19 @@ def delete(module, link, kind):
def resource_to_request(module): def resource_to_request(module):
request = { request = {
u'kind': 'compute#disk', u'kind': 'compute#disk',
u'diskEncryptionKey': RegionDiskDiskencryptionkey(module.params.get('disk_encryption_key', {}), module).to_request(), u'diskEncryptionKey': RegionDiskDiskEncryptionKey(module.params.get('disk_encryption_key', {}), module).to_request(),
u'sourceSnapshotEncryptionKey': RegionDiskSourcesnapshotencryptionkey(module.params.get('source_snapshot_encryption_key', {}), module).to_request(), u'sourceSnapshotEncryptionKey': RegionDiskSourceSnapshotEncryptionKey(module.params.get('source_snapshot_encryption_key', {}), module).to_request(),
u'description': module.params.get('description'), u'description': module.params.get('description'),
u'labels': module.params.get('labels'), u'labels': module.params.get('labels'),
u'licenses': module.params.get('licenses'), u'licenses': module.params.get('licenses'),
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'sizeGb': module.params.get('size_gb'), u'sizeGb': module.params.get('size_gb'),
u'physicalBlockSizeBytes': module.params.get('physical_block_size_bytes'),
u'replicaZones': module.params.get('replica_zones'), u'replicaZones': module.params.get('replica_zones'),
u'type': region_disk_type_selflink(module.params.get('type'), module.params), u'type': region_disk_type_selflink(module.params.get('type'), module.params)
} }
return_vals = {} return_vals = {}
for k, v in request.items(): for k, v in request.items():
if v or v is False: if v:
return_vals[k] = v return_vals[k] = v
return return_vals return return_vals
@ -476,8 +486,8 @@ def return_if_object(module, response, kind, allow_not_found=False):
try: try:
module.raise_for_status(response) module.raise_for_status(response)
result = response.json() result = response.json()
except getattr(json.decoder, 'JSONDecodeError', ValueError): except getattr(json.decoder, 'JSONDecodeError', ValueError) as inst:
module.fail_json(msg="Invalid JSON response with error: %s" % response.text) module.fail_json(msg="Invalid JSON response with error: %s" % inst)
if navigate_hash(result, ['error', 'errors']): if navigate_hash(result, ['error', 'errors']):
module.fail_json(msg=navigate_hash(result, ['error', 'errors'])) module.fail_json(msg=navigate_hash(result, ['error', 'errors']))
@ -518,9 +528,8 @@ def response_to_hash(module, response):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'sizeGb': response.get(u'sizeGb'), u'sizeGb': response.get(u'sizeGb'),
u'users': response.get(u'users'), u'users': response.get(u'users'),
u'physicalBlockSizeBytes': response.get(u'physicalBlockSizeBytes'),
u'replicaZones': response.get(u'replicaZones'), u'replicaZones': response.get(u'replicaZones'),
u'type': response.get(u'type'), u'type': response.get(u'type')
} }
@ -564,9 +573,11 @@ def wait_for_completion(status, op_result, module):
op_id = navigate_hash(op_result, ['name']) op_id = navigate_hash(op_result, ['name'])
op_uri = async_op_url(module, {'op_id': op_id}) op_uri = async_op_url(module, {'op_id': op_id})
while status != 'DONE': while status != 'DONE':
raise_if_errors(op_result, ['error', 'errors'], module) raise_if_errors(op_result, ['error', 'errors'], 'message')
time.sleep(1.0) time.sleep(1.0)
op_result = fetch_resource(module, op_uri, 'compute#operation', False) if status not in ['PENDING', 'RUNNING', 'DONE']:
module.fail_json(msg="Invalid result %s" % status)
op_result = fetch_resource(module, op_uri, 'compute#operation')
status = navigate_hash(op_result, ['status']) status = navigate_hash(op_result, ['status'])
return op_result return op_result
@ -577,7 +588,7 @@ def raise_if_errors(response, err_path, module):
module.fail_json(msg=errors) module.fail_json(msg=errors)
class RegionDiskDiskencryptionkey(object): class RegionDiskDiskEncryptionKey(object):
def __init__(self, request, module): def __init__(self, request, module):
self.module = module self.module = module
if request: if request:
@ -586,13 +597,19 @@ class RegionDiskDiskencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')}) return remove_nones_from_dict({
u'rawKey': self.request.get('raw_key'),
u'sha256': self.request.get('sha256')
})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')}) return remove_nones_from_dict({
u'rawKey': self.request.get(u'rawKey'),
u'sha256': self.request.get(u'sha256')
})
class RegionDiskSourcesnapshotencryptionkey(object): class RegionDiskSourceSnapshotEncryptionKey(object):
def __init__(self, request, module): def __init__(self, request, module):
self.module = module self.module = module
if request: if request:
@ -601,10 +618,16 @@ class RegionDiskSourcesnapshotencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')}) return remove_nones_from_dict({
u'rawKey': self.request.get('raw_key'),
u'sha256': self.request.get('sha256')
})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')}) return remove_nones_from_dict({
u'rawKey': self.request.get(u'rawKey'),
u'sha256': self.request.get(u'sha256')
})
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -18,14 +18,15 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
################################################################################ ################################################################################
# Documentation # Documentation
################################################################################ ################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'} ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ["preview"],
'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
@ -42,9 +43,10 @@ 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
- Each additional filter in the list will act be added as an AND condition (filter1 U(https://cloud.google.com/sdk/gcloud/reference/topic/filters).
and filter2) . Each additional filter in the list will act be added as an AND condition
(filter1 and filter2)
region: region:
description: description:
- A reference to the region where the disk resides. - A reference to the region where the disk resides.
@ -53,7 +55,7 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: " a region disk facts" - name: a region disk facts
gcp_compute_region_disk_facts: gcp_compute_region_disk_facts:
region: us-central1 region: us-central1
filters: filters:
@ -61,19 +63,18 @@ EXAMPLES = '''
project: test_project project: test_project
auth_kind: serviceaccount auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: facts
''' '''
RETURN = ''' RETURN = '''
resources: items:
description: List of resources description: List of items
returned: always returned: always
type: complex type: complex
contains: contains:
labelFingerprint: labelFingerprint:
description: description:
- The fingerprint used for optimistic locking of this resource. Used internally - The fingerprint used for optimistic locking of this resource. Used internally during
during updates. updates.
returned: success returned: success
type: str type: str
creationTimestamp: creationTimestamp:
@ -114,22 +115,21 @@ resources:
type: list type: list
name: name:
description: description:
- Name of the resource. Provided by the client when the resource is created. - Name of the resource. Provided by the client when the resource is created. The name
The name must be 1-63 characters long, and comply with RFC1035. Specifically, must be 1-63 characters long, and comply with RFC1035. Specifically, the name must
the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
which means the first character must be a lowercase letter, and all following which means the first character must be a lowercase letter, and all following characters
characters must be a dash, lowercase letter, or digit, except the last character, must be a dash, lowercase letter, or digit, except the last character, which cannot
which cannot be a dash. be a dash.
returned: success returned: success
type: str type: str
sizeGb: sizeGb:
description: description:
- Size of the persistent disk, specified in GB. You can specify this field when - Size of the persistent disk, specified in GB. You can specify this field when creating
creating a persistent disk using the sourceImage or sourceSnapshot parameter, a persistent disk using the sourceImage or sourceSnapshot parameter, or specify
or specify it alone to create an empty persistent disk. it alone to create an empty persistent disk.
- If you specify this field along with sourceImage or sourceSnapshot, the value - If you specify this field along with sourceImage or sourceSnapshot, the value of
of sizeGb must not be less than the size of the sourceImage or the size of sizeGb must not be less than the size of the sourceImage or the size of the snapshot.
the snapshot.
returned: success returned: success
type: int type: int
users: users:
@ -138,15 +138,6 @@ resources:
.' .'
returned: success returned: success
type: list type: list
physicalBlockSizeBytes:
description:
- Physical block size of the persistent disk, in bytes. If not present in a
request, a default value is used. Currently supported sizes are 4096 and 16384,
other sizes may be added in the future.
- If an unsupported value is requested, the error message will list the supported
values for the caller's project.
returned: success
type: int
replicaZones: replicaZones:
description: description:
- URLs of the zones where the disk should be replicated to. - URLs of the zones where the disk should be replicated to.
@ -154,8 +145,8 @@ resources:
type: list type: list
type: type:
description: description:
- URL of the disk type resource describing which disk type to use to create - URL of the disk type resource describing which disk type to use to create the disk.
the disk. Provide this when creating the disk. Provide this when creating the disk.
returned: success returned: success
type: str type: str
region: region:
@ -166,61 +157,62 @@ resources:
diskEncryptionKey: diskEncryptionKey:
description: description:
- Encrypts the disk using a customer-supplied encryption key. - Encrypts the disk using a customer-supplied encryption key.
- After you encrypt a disk with a customer-supplied key, you must provide the - After you encrypt a disk with a customer-supplied key, you must provide the same
same key if you use the disk later (e.g. to create a disk snapshot or an image, key if you use the disk later (e.g. to create a disk snapshot or an image, or to
or to attach the disk to a virtual machine). attach the disk to a virtual machine).
- Customer-supplied encryption keys do not protect access to metadata of the - Customer-supplied encryption keys do not protect access to metadata of the disk.
disk. - If you do not provide an encryption key when creating the disk, then the disk will
- If you do not provide an encryption key when creating the disk, then the disk be encrypted using an automatically generated key and you do not need to provide
will be encrypted using an automatically generated key and you do not need a key to use the disk later.
to provide a key to use the disk later.
returned: success returned: success
type: complex type: complex
contains: contains:
rawKey: rawKey:
description: description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64
base64 to either encrypt or decrypt this resource. to either encrypt or decrypt this resource.
returned: success returned: success
type: str type: str
sha256: sha256:
description: description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key
key that protects this resource. that protects this resource.
returned: success returned: success
type: str type: str
sourceSnapshot: sourceSnapshot:
description: description:
- 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. For example, the following are valid values: *
`U(https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot`)
* `projects/project/global/snapshots/snapshot` * `global/snapshots/snapshot` .'
returned: success returned: success
type: dict type: dict
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 source
source snapshot is protected by a customer-supplied encryption key. snapshot is protected by a customer-supplied encryption key.
returned: success returned: success
type: complex type: complex
contains: contains:
rawKey: rawKey:
description: description:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64
base64 to either encrypt or decrypt this resource. to either encrypt or decrypt this resource.
returned: success returned: success
type: str type: str
sha256: sha256:
description: description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption - The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key
key that protects this resource. that protects this resource.
returned: success returned: success
type: str type: str
sourceSnapshotId: sourceSnapshotId:
description: description:
- The unique ID of the snapshot used to create this disk. This value identifies - The unique ID of the snapshot used to create this disk. This value identifies the
the exact snapshot that was used to create this persistent disk. For example, exact snapshot that was used to create this persistent disk. For example, if you
if you created the persistent disk from a snapshot that was later deleted created the persistent disk from a snapshot that was later deleted and recreated
and recreated under the same name, the source snapshot ID would identify the under the same name, the source snapshot ID would identify the exact version of
exact version of the snapshot that was used. the snapshot that was used.
returned: success returned: success
type: str type: str
''' '''
@ -237,9 +229,14 @@ import json
def main(): def main():
module = GcpModule(argument_spec=dict(filters=dict(type='list', elements='str'), region=dict(required=True, type='str'))) module = GcpModule(
argument_spec=dict(
filters=dict(type='list', elements='str'),
region=dict(required=True, type='str')
)
)
if not module.params['scopes']: if 'scopes' not in module.params:
module.params['scopes'] = ['https://www.googleapis.com/auth/compute'] module.params['scopes'] = ['https://www.googleapis.com/auth/compute']
items = fetch_list(module, collection(module), query_options(module.params['filters'])) items = fetch_list(module, collection(module), query_options(module.params['filters']))
@ -247,7 +244,9 @@ def main():
items = items.get('items') items = items.get('items')
else: else:
items = [] items = []
return_value = {'resources': items} return_value = {
'items': items
}
module.exit_json(**return_value) module.exit_json(**return_value)

View file

@ -139,7 +139,34 @@ options:
set this network to a dictionary with the selfLink key where the value is the selfLink set this network to a dictionary with the selfLink key where the value is the selfLink
of your Network.' of your Network.'
required: true required: true
enable_flow_logs:
description:
- Whether to enable flow logging for this subnetwork.
required: false
type: bool
version_added: 2.8
secondary_ip_ranges:
description:
- An array of configurations for secondary IP ranges for VM instances contained in
this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange
of the subnetwork. The alias IPs may belong to either primary or secondary ranges.
required: false
version_added: 2.8
suboptions:
range_name:
description:
- The name associated with this subnetwork secondary range, used when adding an alias
IP range to a VM instance. The name must be 1-63 characters long, and comply with
RFC1035. The name must be unique within the subnetwork.
required: true
ip_cidr_range: ip_cidr_range:
description:
- The range of IP addresses belonging to this subnetwork secondary range. Provide
this property when you create the subnetwork.
- Ranges must be unique and non-overlapping with all primary and secondary IP ranges
within a network. Only IPv4 is supported.
required: true
private_ip_google_access:
description: description:
- The range of IP addresses belonging to this subnetwork secondary range. - The range of IP addresses belonging to this subnetwork secondary range.
Provide this property when you create the subnetwork. Provide this property when you create the subnetwork.
@ -233,6 +260,40 @@ RETURN = '''
- 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: dict
enableFlowLogs:
description:
- Whether to enable flow logging for this subnetwork.
returned: success
type: bool
fingerprint:
description:
- Fingerprint of this resource. This field is used internally during updates of this
resource.
returned: success
type: str
secondaryIpRanges:
description:
- An array of configurations for secondary IP ranges for VM instances contained in
this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange
of the subnetwork. The alias IPs may belong to either primary or secondary ranges.
returned: success
type: complex
contains:
rangeName:
description:
- The name associated with this subnetwork secondary range, used when adding an alias
IP range to a VM instance. The name must be 1-63 characters long, and comply with
RFC1035. The name must be unique within the subnetwork.
returned: success
type: str
ipCidrRange:
description:
- The range of IP addresses belonging to this subnetwork secondary range. Provide
this property when you create the subnetwork.
- Ranges must be unique and non-overlapping with all primary and secondary IP ranges
within a network. Only IPv4 is supported.
returned: success
type: str
privateIpGoogleAccess: privateIpGoogleAccess:
description: description:
- Whether the VMs in this subnet can access Google services without assigned external - Whether the VMs in this subnet can access Google services without assigned external
@ -270,9 +331,10 @@ def main():
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
network=dict(required=True, type='dict'), network=dict(required=True, type='dict'),
enable_flow_logs=dict(type='bool'), enable_flow_logs=dict(type='bool'),
secondary_ip_ranges=dict( secondary_ip_ranges=dict(type='list', elements='dict', options=dict(
type='list', elements='dict', options=dict(range_name=dict(required=True, type='str'), ip_cidr_range=dict(required=True, type='str')) range_name=dict(required=True, type='str'),
), ip_cidr_range=dict(required=True, type='str')
)),
private_ip_google_access=dict(type='bool'), private_ip_google_access=dict(type='bool'),
region=dict(required=True, type='str'), region=dict(required=True, type='str'),
) )
@ -323,6 +385,8 @@ def update(module, link, kind, fetch):
def update_fields(module, request, response): def update_fields(module, request, response):
if response.get('ipCidrRange') != request.get('ipCidrRange'): if response.get('ipCidrRange') != request.get('ipCidrRange'):
ip_cidr_range_update(module, request, response) ip_cidr_range_update(module, request, response)
if response.get('enableFlowLogs') != request.get('enableFlowLogs') or response.get('secondaryIpRanges') != request.get('secondaryIpRanges'):
enable_flow_logs_update(module, request, response)
if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'): if response.get('privateIpGoogleAccess') != request.get('privateIpGoogleAccess'):
private_ip_google_access_update(module, request, response) private_ip_google_access_update(module, request, response)
@ -340,6 +404,21 @@ def ip_cidr_range_update(module, request, response):
) )
def enable_flow_logs_update(module, request, response):
auth = GcpSession(module, 'compute')
auth.patch(
''.join([
"https://www.googleapis.com/compute/v1/",
"projects/{project}/regions/{region}/subnetworks/{name}"
]).format(**module.params),
{
u'enableFlowLogs': module.params.get('enable_flow_logs'),
u'fingerprint': response.get('fingerprint'),
u'secondaryIpRanges': SubnetworkSecondaryIpRangesArray(module.params.get('secondary_ip_ranges', []), module).to_request()
}
)
def private_ip_google_access_update(module, request, response): def private_ip_google_access_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
auth.post( auth.post(
@ -366,7 +445,7 @@ def resource_to_request(module):
u'name': module.params.get('name'), u'name': module.params.get('name'),
u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'), u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'),
u'enableFlowLogs': module.params.get('enable_flow_logs'), u'enableFlowLogs': module.params.get('enable_flow_logs'),
u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request(), u'secondaryIpRanges': SubnetworkSecondaryIpRangesArray(module.params.get('secondary_ip_ranges', []), module).to_request(),
u'privateIpGoogleAccess': module.params.get('private_ip_google_access'), u'privateIpGoogleAccess': module.params.get('private_ip_google_access'),
u'region': module.params.get('region'), u'region': module.params.get('region'),
} }
@ -443,7 +522,7 @@ def response_to_hash(module, response):
u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'), u'network': replace_resource_dict(module.params.get(u'network', {}), 'selfLink'),
u'enableFlowLogs': response.get(u'enableFlowLogs'), u'enableFlowLogs': response.get(u'enableFlowLogs'),
u'fingerprint': response.get(u'fingerprint'), u'fingerprint': response.get(u'fingerprint'),
u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(response.get(u'secondaryIpRanges', []), module).from_response(), u'secondaryIpRanges': SubnetworkSecondaryIpRangesArray(response.get(u'secondaryIpRanges', []), module).from_response(),
u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'), u'privateIpGoogleAccess': response.get(u'privateIpGoogleAccess'),
u'region': module.params.get('region'), u'region': module.params.get('region'),
} }
@ -484,7 +563,7 @@ def raise_if_errors(response, err_path, module):
module.fail_json(msg=errors) module.fail_json(msg=errors)
class SubnetworkSecondaryiprangesArray(object): class SubnetworkSecondaryIpRangesArray(object):
def __init__(self, request, module): def __init__(self, request, module):
self.module = module self.module = module
if request: if request:
@ -505,10 +584,16 @@ class SubnetworkSecondaryiprangesArray(object):
return items return items
def _request_for_item(self, item): def _request_for_item(self, item):
return remove_nones_from_dict({u'rangeName': item.get('range_name'), u'ipCidrRange': item.get('ip_cidr_range')}) return remove_nones_from_dict({
u'rangeName': item.get('range_name'),
u'ipCidrRange': item.get('ip_cidr_range')
})
def _response_from_item(self, item): def _response_from_item(self, item):
return remove_nones_from_dict({u'rangeName': item.get(u'rangeName'), u'ipCidrRange': item.get(u'ipCidrRange')}) return remove_nones_from_dict({
u'rangeName': item.get(u'rangeName'),
u'ipCidrRange': item.get(u'ipCidrRange')
})
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -115,6 +115,40 @@ items:
- 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: dict
enableFlowLogs:
description:
- Whether to enable flow logging for this subnetwork.
returned: success
type: bool
fingerprint:
description:
- Fingerprint of this resource. This field is used internally during updates of this
resource.
returned: success
type: str
secondaryIpRanges:
description:
- An array of configurations for secondary IP ranges for VM instances contained in
this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange
of the subnetwork. The alias IPs may belong to either primary or secondary ranges.
returned: success
type: complex
contains:
rangeName:
description:
- The name associated with this subnetwork secondary range, used when adding an alias
IP range to a VM instance. The name must be 1-63 characters long, and comply with
RFC1035. The name must be unique within the subnetwork.
returned: success
type: str
ipCidrRange:
description:
- The range of IP addresses belonging to this subnetwork secondary range. Provide
this property when you create the subnetwork.
- Ranges must be unique and non-overlapping with all primary and secondary IP ranges
within a network. Only IPv4 is supported.
returned: success
type: str
privateIpGoogleAccess: privateIpGoogleAccess:
description: description:
- Whether the VMs in this subnet can access Google services without assigned external - Whether the VMs in this subnet can access Google services without assigned external

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -49,7 +49,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length >= 1 - results['resources'] | length >= 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a dataset that already exists - name: create a dataset that already exists
gcp_bigquery_dataset: gcp_bigquery_dataset:
@ -93,7 +93,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a dataset that does not exist - name: delete a dataset that does not exist
gcp_bigquery_dataset: gcp_bigquery_dataset:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -66,7 +66,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length >= 1 - results['resources'] | length >= 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a table that already exists - name: create a table that already exists
gcp_bigquery_table: gcp_bigquery_table:
@ -117,7 +117,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a table that does not exist - name: delete a table that does not exist
gcp_bigquery_table: gcp_bigquery_table:

View file

@ -1 +1,2 @@
cloud/gcp cloud/gcp
unsupported

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,24 +15,20 @@
# Pre-test setup # Pre-test setup
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: 'test-address1' name: test-address1
region: 'us-west1' region: us-west1
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 }}"
scopes:
- https://www.googleapis.com/auth/compute
state: absent state: absent
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a address - name: create a address
gcp_compute_address: gcp_compute_address:
name: 'test-address1' name: test-address1
region: 'us-west1' region: us-west1
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 }}"
scopes:
- https://www.googleapis.com/auth/compute
state: present state: present
register: result register: result
- name: assert changed is true - name: assert changed is true
@ -41,23 +37,28 @@
- result.changed == true - result.changed == true
- "result.kind == 'compute#address'" - "result.kind == 'compute#address'"
- name: verify that address was created - name: verify that address was created
shell: | gcp_compute_address_facts:
gcloud compute addresses describe --project="{{ gcp_project}}" --region=us-west1 test-address1 filters:
register: results - name = test-address1
- name: verify that command succeeded region: us-west1
assert:
that:
- results.rc == 0
# ----------------------------------------------------------------------------
- name: create a address that already exists
gcp_compute_address:
name: 'test-address1'
region: 'us-west1'
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 }}"
scopes: scopes:
- https://www.googleapis.com/auth/compute - https://www.googleapis.com/auth/compute
register: results
- name: verify that command succeeded
assert:
that:
- results['resources'] | length == 1
# ----------------------------------------------------------------------------
- name: create a address that already exists
gcp_compute_address:
name: test-address1
region: us-west1
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: present state: present
register: result register: result
- name: assert changed is false - name: assert changed is false
@ -68,13 +69,11 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: 'test-address1' name: test-address1
region: 'us-west1' region: us-west1
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 }}"
scopes:
- https://www.googleapis.com/auth/compute
state: absent state: absent
register: result register: result
- name: assert changed is true - name: assert changed is true
@ -83,25 +82,28 @@
- result.changed == true - result.changed == true
- result.has_key('kind') == False - result.has_key('kind') == False
- name: verify that address was deleted - name: verify that address was deleted
shell: | gcp_compute_address_facts:
gcloud compute addresses describe --project="{{ gcp_project}}" --region=us-west1 test-address1 filters:
register: results - name = test-address1
failed_when: results.rc == 0 region: us-west1
- name: verify that command succeeded
assert:
that:
- results.rc == 1
- "\"'projects/{{ gcp_project }}/regions/us-west1/addresses/test-address1' was not found\" in results.stderr"
# ----------------------------------------------------------------------------
- name: delete a address that does not exist
gcp_compute_address:
name: 'test-address1'
region: 'us-west1'
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 }}"
scopes: scopes:
- https://www.googleapis.com/auth/compute - https://www.googleapis.com/auth/compute
register: results
- name: verify that command succeeded
assert:
that:
- results['resources'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a address that does not exist
gcp_compute_address:
name: test-address1
region: us-west1
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent state: absent
register: result register: result
- name: assert changed is false - name: assert changed is false

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a bucket - name: create a bucket
gcp_storage_bucket: gcp_storage_bucket:
name: "bucket-backendbucket" name: bucket-backendbucket
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 }}"
@ -26,7 +26,7 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
bucket_name: "{{ bucket.name }}" bucket_name: "{{ bucket.name }}"
description: A BackendBucket to connect LNB w/ Storage Bucket description: A BackendBucket to connect LNB w/ Storage Bucket
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -37,7 +37,7 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
bucket_name: "{{ bucket.name }}" bucket_name: "{{ bucket.name }}"
description: A BackendBucket to connect LNB w/ Storage Bucket description: A BackendBucket to connect LNB w/ Storage Bucket
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -61,14 +61,14 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a backend bucket that already exists - name: create a backend bucket that already exists
gcp_compute_backend_bucket: gcp_compute_backend_bucket:
name: "{{ resource_name }}" name: "{{ resource_name }}"
bucket_name: "{{ bucket.name }}" bucket_name: "{{ bucket.name }}"
description: A BackendBucket to connect LNB w/ Storage Bucket description: A BackendBucket to connect LNB w/ Storage Bucket
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -85,7 +85,7 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
bucket_name: "{{ bucket.name }}" bucket_name: "{{ bucket.name }}"
description: A BackendBucket to connect LNB w/ Storage Bucket description: A BackendBucket to connect LNB w/ Storage Bucket
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -109,14 +109,14 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a backend bucket that does not exist - name: delete a backend bucket that does not exist
gcp_compute_backend_bucket: gcp_compute_backend_bucket:
name: "{{ resource_name }}" name: "{{ resource_name }}"
bucket_name: "{{ bucket.name }}" bucket_name: "{{ bucket.name }}"
description: A BackendBucket to connect LNB w/ Storage Bucket description: A BackendBucket to connect LNB w/ Storage Bucket
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -132,7 +132,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a bucket - name: delete a bucket
gcp_storage_bucket: gcp_storage_bucket:
name: "bucket-backendbucket" name: bucket-backendbucket
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a instance group - name: create a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-backendservice" name: instancegroup-backendservice
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -24,7 +24,7 @@
register: instancegroup register: instancegroup
- name: create a http health check - name: create a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:
name: "httphealthcheck-backendservice" name: httphealthcheck-backendservice
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -41,7 +41,7 @@
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -54,7 +54,7 @@
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -78,7 +78,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a backend service that already exists - name: create a backend service that already exists
gcp_compute_backend_service: gcp_compute_backend_service:
@ -87,7 +87,7 @@
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -106,7 +106,7 @@
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -130,7 +130,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a backend service that does not exist - name: delete a backend service that does not exist
gcp_compute_backend_service: gcp_compute_backend_service:
@ -139,7 +139,7 @@
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -155,7 +155,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a http health check - name: delete a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:
name: "httphealthcheck-backendservice" name: httphealthcheck-backendservice
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -168,7 +168,7 @@
ignore_errors: true ignore_errors: true
- name: delete a instance group - name: delete a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-backendservice" name: instancegroup-backendservice
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -56,7 +56,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a disk that already exists - name: create a disk that already exists
gcp_compute_disk: gcp_compute_disk:
@ -107,7 +107,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a disk that does not exist - name: delete a disk that does not exist
gcp_compute_disk: gcp_compute_disk:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -65,7 +65,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a firewall that already exists - name: create a firewall that already exists
gcp_compute_firewall: gcp_compute_firewall:
@ -125,7 +125,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a firewall that does not exist - name: delete a firewall that does not exist
gcp_compute_firewall: gcp_compute_firewall:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a address - name: create a address
gcp_compute_address: gcp_compute_address:
name: "address-forwardingrule" name: address-forwardingrule
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -24,7 +24,7 @@
register: address register: address
- name: create a target pool - name: create a target pool
gcp_compute_target_pool: gcp_compute_target_pool:
name: "targetpool-forwardingrule" name: targetpool-forwardingrule
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -76,7 +76,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a forwarding rule that already exists - name: create a forwarding rule that already exists
gcp_compute_forwarding_rule: gcp_compute_forwarding_rule:
@ -129,7 +129,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a forwarding rule that does not exist - name: delete a forwarding rule that does not exist
gcp_compute_forwarding_rule: gcp_compute_forwarding_rule:
@ -154,7 +154,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a target pool - name: delete a target pool
gcp_compute_target_pool: gcp_compute_target_pool:
name: "targetpool-forwardingrule" name: targetpool-forwardingrule
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -164,7 +164,7 @@
ignore_errors: true ignore_errors: true
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: "address-forwardingrule" name: address-forwardingrule
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -47,7 +47,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a global address that already exists - name: create a global address that already exists
gcp_compute_global_address: gcp_compute_global_address:
@ -89,7 +89,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a global address that does not exist - name: delete a global address that does not exist
gcp_compute_global_address: gcp_compute_global_address:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a global address - name: create a global address
gcp_compute_global_address: gcp_compute_global_address:
name: "globaladdress-globalforwardingrule" name: globaladdress-globalforwardingrule
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 }}"
@ -23,7 +23,7 @@
register: globaladdress register: globaladdress
- name: create a instance group - name: create a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-globalforwardingrule" name: instancegroup-globalforwardingrule
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -32,7 +32,7 @@
register: instancegroup register: instancegroup
- name: create a http health check - name: create a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:
name: "httphealthcheck-globalforwardingrule" name: httphealthcheck-globalforwardingrule
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -44,12 +44,12 @@
register: healthcheck register: healthcheck
- name: create a backend service - name: create a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-globalforwardingrule" name: backendservice-globalforwardingrule
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -57,7 +57,7 @@
register: backendservice register: backendservice
- name: create a url map - name: create a url map
gcp_compute_url_map: gcp_compute_url_map:
name: "urlmap-globalforwardingrule" name: urlmap-globalforwardingrule
default_service: "{{ backendservice }}" default_service: "{{ backendservice }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -66,7 +66,7 @@
register: urlmap register: urlmap
- name: create a target http proxy - name: create a target http proxy
gcp_compute_target_http_proxy: gcp_compute_target_http_proxy:
name: "targethttpproxy-globalforwardingrule" name: targethttpproxy-globalforwardingrule
url_map: "{{ urlmap }}" url_map: "{{ urlmap }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -115,7 +115,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a global forwarding rule that already exists - name: create a global forwarding rule that already exists
gcp_compute_global_forwarding_rule: gcp_compute_global_forwarding_rule:
@ -165,7 +165,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a global forwarding rule that does not exist - name: delete a global forwarding rule that does not exist
gcp_compute_global_forwarding_rule: gcp_compute_global_forwarding_rule:
@ -189,7 +189,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a target http proxy - name: delete a target http proxy
gcp_compute_target_http_proxy: gcp_compute_target_http_proxy:
name: "targethttpproxy-globalforwardingrule" name: targethttpproxy-globalforwardingrule
url_map: "{{ urlmap }}" url_map: "{{ urlmap }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -199,7 +199,7 @@
ignore_errors: true ignore_errors: true
- name: delete a url map - name: delete a url map
gcp_compute_url_map: gcp_compute_url_map:
name: "urlmap-globalforwardingrule" name: urlmap-globalforwardingrule
default_service: "{{ backendservice }}" default_service: "{{ backendservice }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -209,12 +209,12 @@
ignore_errors: true ignore_errors: true
- name: delete a backend service - name: delete a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-globalforwardingrule" name: backendservice-globalforwardingrule
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -223,7 +223,7 @@
ignore_errors: true 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-globalforwardingrule" name: httphealthcheck-globalforwardingrule
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -236,7 +236,7 @@
ignore_errors: true ignore_errors: true
- name: delete a instance group - name: delete a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-globalforwardingrule" name: instancegroup-globalforwardingrule
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -246,7 +246,7 @@
ignore_errors: true ignore_errors: true
- name: delete a global address - name: delete a global address
gcp_compute_global_address: gcp_compute_global_address:
name: "globaladdress-globalforwardingrule" name: globaladdress-globalforwardingrule
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -63,7 +63,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a health check that already exists - name: create a health check that already exists
gcp_compute_health_check: gcp_compute_health_check:
@ -121,7 +121,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a health check that does not exist - name: delete a health check that does not exist
gcp_compute_health_check: gcp_compute_health_check:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -55,7 +55,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a http health check that already exists - name: create a http health check that already exists
gcp_compute_http_health_check: gcp_compute_http_health_check:
@ -105,7 +105,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a http health check that does not exist - name: delete a http health check that does not exist
gcp_compute_http_health_check: gcp_compute_http_health_check:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -55,7 +55,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a https health check that already exists - name: create a https health check that already exists
gcp_compute_https_health_check: gcp_compute_https_health_check:
@ -105,7 +105,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a https health check that does not exist - name: delete a https health check that does not exist
gcp_compute_https_health_check: gcp_compute_https_health_check:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a disk - name: create a disk
gcp_compute_disk: gcp_compute_disk:
name: "disk-image" name: disk-image
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -58,7 +58,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a image that already exists - name: create a image that already exists
gcp_compute_image: gcp_compute_image:
@ -102,7 +102,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a image that does not exist - name: delete a image that does not exist
gcp_compute_image: gcp_compute_image:
@ -123,7 +123,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a disk - name: delete a disk
gcp_compute_disk: gcp_compute_disk:
name: "disk-image" name: disk-image
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a disk - name: create a disk
gcp_compute_disk: gcp_compute_disk:
name: "disk-instance" name: disk-instance
size_gb: 50 size_gb: 50
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
zone: us-central1-a zone: us-central1-a
@ -26,7 +26,7 @@
register: disk register: disk
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: network-instance
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 }}"
@ -34,7 +34,7 @@
register: network register: network
- name: create a address - name: create a address
gcp_compute_address: gcp_compute_address:
name: "address-instance" name: address-instance
region: us-central1 region: us-central1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -46,8 +46,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
machine_type: n1-standard-1 machine_type: n1-standard-1
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
source: "{{ disk }}" source: "{{ disk }}"
metadata: metadata:
startup-script-url: gs:://graphite-playground/bootstrap.sh startup-script-url: gs:://graphite-playground/bootstrap.sh
@ -69,8 +69,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
machine_type: n1-standard-1 machine_type: n1-standard-1
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
source: "{{ disk }}" source: "{{ disk }}"
metadata: metadata:
startup-script-url: gs:://graphite-playground/bootstrap.sh startup-script-url: gs:://graphite-playground/bootstrap.sh
@ -106,15 +106,15 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a instance that already exists - name: create a instance that already exists
gcp_compute_instance: gcp_compute_instance:
name: "{{ resource_name }}" name: "{{ resource_name }}"
machine_type: n1-standard-1 machine_type: n1-standard-1
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
source: "{{ disk }}" source: "{{ disk }}"
metadata: metadata:
startup-script-url: gs:://graphite-playground/bootstrap.sh startup-script-url: gs:://graphite-playground/bootstrap.sh
@ -142,8 +142,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
machine_type: n1-standard-1 machine_type: n1-standard-1
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
source: "{{ disk }}" source: "{{ disk }}"
metadata: metadata:
startup-script-url: gs:://graphite-playground/bootstrap.sh startup-script-url: gs:://graphite-playground/bootstrap.sh
@ -179,15 +179,15 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a instance that does not exist - name: delete a instance that does not exist
gcp_compute_instance: gcp_compute_instance:
name: "{{ resource_name }}" name: "{{ resource_name }}"
machine_type: n1-standard-1 machine_type: n1-standard-1
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
source: "{{ disk }}" source: "{{ disk }}"
metadata: metadata:
startup-script-url: gs:://graphite-playground/bootstrap.sh startup-script-url: gs:://graphite-playground/bootstrap.sh
@ -214,7 +214,7 @@
# If errors happen, don't crash the playbook! # 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
region: us-central1 region: us-central1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -224,7 +224,7 @@
ignore_errors: true ignore_errors: true
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: network-instance
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 }}"
@ -233,7 +233,7 @@
ignore_errors: true ignore_errors: true
- name: delete a disk - name: delete a disk
gcp_compute_disk: gcp_compute_disk:
name: "disk-instance" name: disk-instance
size_gb: 50 size_gb: 50
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
zone: us-central1-a zone: us-central1-a

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-instancegroup" name: network-instancegroup
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 }}"
@ -66,7 +66,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a instance group that already exists - name: create a instance group that already exists
gcp_compute_instance_group: gcp_compute_instance_group:
@ -119,7 +119,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a instance group that does not exist - name: delete a instance group that does not exist
gcp_compute_instance_group: gcp_compute_instance_group:
@ -144,7 +144,7 @@
# If errors happen, don't crash the playbook! # 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
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-instancetemplate" name: network-instancetemplate
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 }}"
@ -23,7 +23,7 @@
register: network register: network
- name: create a address - name: create a address
gcp_compute_address: gcp_compute_address:
name: "address-instancetemplate" name: address-instancetemplate
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -35,8 +35,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
properties: properties:
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
initialize_params: initialize_params:
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
machine_type: n1-standard-1 machine_type: n1-standard-1
@ -94,7 +94,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a instance group manager that already exists - name: create a instance group manager that already exists
gcp_compute_instance_group_manager: gcp_compute_instance_group_manager:
@ -145,7 +145,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a instance group manager that does not exist - name: delete a instance group manager that does not exist
gcp_compute_instance_group_manager: gcp_compute_instance_group_manager:
@ -172,8 +172,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
properties: properties:
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
initialize_params: initialize_params:
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
machine_type: n1-standard-1 machine_type: n1-standard-1
@ -191,7 +191,7 @@
ignore_errors: true ignore_errors: true
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: "address-instancetemplate" name: address-instancetemplate
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -201,7 +201,7 @@
ignore_errors: true ignore_errors: true
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instancetemplate" name: network-instancetemplate
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-instancetemplate" name: network-instancetemplate
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 }}"
@ -23,7 +23,7 @@
register: network register: network
- name: create a address - name: create a address
gcp_compute_address: gcp_compute_address:
name: "address-instancetemplate" name: address-instancetemplate
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -35,8 +35,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
properties: properties:
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
initialize_params: initialize_params:
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
machine_type: n1-standard-1 machine_type: n1-standard-1
@ -56,8 +56,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
properties: properties:
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
initialize_params: initialize_params:
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
machine_type: n1-standard-1 machine_type: n1-standard-1
@ -90,15 +90,15 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a instance template that already exists - name: create a instance template that already exists
gcp_compute_instance_template: gcp_compute_instance_template:
name: "{{ resource_name }}" name: "{{ resource_name }}"
properties: properties:
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
initialize_params: initialize_params:
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
machine_type: n1-standard-1 machine_type: n1-standard-1
@ -124,8 +124,8 @@
name: "{{ resource_name }}" name: "{{ resource_name }}"
properties: properties:
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
initialize_params: initialize_params:
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
machine_type: n1-standard-1 machine_type: n1-standard-1
@ -158,15 +158,15 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a instance template that does not exist - name: delete a instance template that does not exist
gcp_compute_instance_template: gcp_compute_instance_template:
name: "{{ resource_name }}" name: "{{ resource_name }}"
properties: properties:
disks: disks:
- auto_delete: true - auto_delete: 'true'
boot: true boot: 'true'
initialize_params: initialize_params:
source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
machine_type: n1-standard-1 machine_type: n1-standard-1
@ -191,7 +191,7 @@
# If errors happen, don't crash the playbook! # 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
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -201,7 +201,7 @@
ignore_errors: true ignore_errors: true
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instancetemplate" name: network-instancetemplate
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -16,7 +16,7 @@
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "{{ resource_name }}" name: "{{ resource_name }}"
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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 }}"
@ -25,7 +25,7 @@
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "{{ resource_name }}" name: "{{ resource_name }}"
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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 }}"
@ -49,12 +49,12 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a network that already exists - name: create a network that already exists
gcp_compute_network: gcp_compute_network:
name: "{{ resource_name }}" name: "{{ resource_name }}"
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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 }}"
@ -69,7 +69,7 @@
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "{{ resource_name }}" name: "{{ resource_name }}"
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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,12 +93,12 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a network that does not exist - name: delete a network that does not exist
gcp_compute_network: gcp_compute_network:
name: "{{ resource_name }}" name: "{{ resource_name }}"
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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

@ -21,8 +21,8 @@
raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
region: us-central1 region: us-central1
replica_zones: replica_zones:
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - us-central1-a
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - us-central1-f
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:
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - us-central1-a
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - us-central1-f
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:
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - us-central1-a
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - us-central1-f
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:
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - us-central1-a
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - us-central1-f
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:
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - us-central1-a
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - us-central1-f
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-route" name: network-route
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 }}"
@ -67,7 +67,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a route that already exists - name: create a route that already exists
gcp_compute_route: gcp_compute_route:
@ -121,7 +121,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a route that does not exist - name: delete a route that does not exist
gcp_compute_route: gcp_compute_route:
@ -147,7 +147,7 @@
# If errors happen, don't crash the playbook! # 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
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-router" name: network-router
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 }}"
@ -76,7 +76,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a router that already exists - name: create a router that already exists
gcp_compute_router: gcp_compute_router:
@ -139,7 +139,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a router that does not exist - name: delete a router that does not exist
gcp_compute_router: gcp_compute_router:
@ -169,7 +169,7 @@
# If errors happen, don't crash the playbook! # 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
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -57,7 +57,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a ssl policy that already exists - name: create a ssl policy that already exists
gcp_compute_ssl_policy: gcp_compute_ssl_policy:
@ -109,7 +109,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a ssl policy that does not exist - name: delete a ssl policy that does not exist
gcp_compute_ssl_policy: gcp_compute_ssl_policy:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,8 +15,8 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-subnetwork" name: network-subnetwork
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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 }}"
@ -63,7 +63,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a subnetwork that already exists - name: create a subnetwork that already exists
gcp_compute_subnetwork: gcp_compute_subnetwork:
@ -112,7 +112,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a subnetwork that does not exist - name: delete a subnetwork that does not exist
gcp_compute_subnetwork: gcp_compute_subnetwork:
@ -135,8 +135,8 @@
# If errors happen, don't crash the playbook! # 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
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a instance group - name: create a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-targethttpproxy" name: instancegroup-targethttpproxy
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -24,7 +24,7 @@
register: instancegroup register: instancegroup
- name: create a http health check - name: create a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:
name: "httphealthcheck-targethttpproxy" name: httphealthcheck-targethttpproxy
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -36,12 +36,12 @@
register: healthcheck register: healthcheck
- name: create a backend service - name: create a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-targethttpproxy" name: backendservice-targethttpproxy
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -49,7 +49,7 @@
register: backendservice register: backendservice
- name: create a url map - name: create a url map
gcp_compute_url_map: gcp_compute_url_map:
name: "urlmap-targethttpproxy" name: urlmap-targethttpproxy
default_service: "{{ backendservice }}" default_service: "{{ backendservice }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -92,7 +92,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a target http proxy that already exists - name: create a target http proxy that already exists
gcp_compute_target_http_proxy: gcp_compute_target_http_proxy:
@ -136,7 +136,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a target http proxy that does not exist - name: delete a target http proxy that does not exist
gcp_compute_target_http_proxy: gcp_compute_target_http_proxy:
@ -157,7 +157,7 @@
# If errors happen, don't crash the playbook! # 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
default_service: "{{ backendservice }}" default_service: "{{ backendservice }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -167,12 +167,12 @@
ignore_errors: true 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
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -181,7 +181,7 @@
ignore_errors: true 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
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -194,7 +194,7 @@
ignore_errors: true 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
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -50,7 +50,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a target pool that already exists - name: create a target pool that already exists
gcp_compute_target_pool: gcp_compute_target_pool:
@ -95,7 +95,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a target pool that does not exist - name: delete a target pool that does not exist
gcp_compute_target_pool: gcp_compute_target_pool:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a instance group - name: create a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-targettcpproxy" name: instancegroup-targettcpproxy
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -24,7 +24,7 @@
register: instancegroup register: instancegroup
- name: create a health check - name: create a health check
gcp_compute_health_check: gcp_compute_health_check:
name: "healthcheck-targettcpproxy" name: healthcheck-targettcpproxy
type: TCP type: TCP
tcp_health_check: tcp_health_check:
port_name: service-health port_name: service-health
@ -40,7 +40,7 @@
register: healthcheck register: healthcheck
- name: create a backend service - name: create a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-targettcpproxy" name: backendservice-targettcpproxy
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
@ -89,7 +89,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a target tcp proxy that already exists - name: create a target tcp proxy that already exists
gcp_compute_target_tcp_proxy: gcp_compute_target_tcp_proxy:
@ -135,7 +135,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a target tcp proxy that does not exist - name: delete a target tcp proxy that does not exist
gcp_compute_target_tcp_proxy: gcp_compute_target_tcp_proxy:
@ -157,7 +157,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a backend service - name: delete a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-targettcpproxy" name: backendservice-targettcpproxy
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
@ -171,7 +171,7 @@
ignore_errors: true ignore_errors: true
- name: delete a health check - name: delete a health check
gcp_compute_health_check: gcp_compute_health_check:
name: "healthcheck-targettcpproxy" name: healthcheck-targettcpproxy
type: TCP type: TCP
tcp_health_check: tcp_health_check:
port_name: service-health port_name: service-health
@ -188,7 +188,7 @@
ignore_errors: true ignore_errors: true
- name: delete a instance group - name: delete a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-targettcpproxy" name: instancegroup-targettcpproxy
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a address - name: create a address
gcp_compute_address: gcp_compute_address:
name: "address-vpngateway" name: address-vpngateway
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -24,7 +24,7 @@
register: address register: address
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-vpngateway" name: network-vpngateway
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 }}"
@ -69,7 +69,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a target vpn gateway that already exists - name: create a target vpn gateway that already exists
gcp_compute_target_vpn_gateway: gcp_compute_target_vpn_gateway:
@ -116,7 +116,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a target vpn gateway that does not exist - name: delete a target vpn gateway that does not exist
gcp_compute_target_vpn_gateway: gcp_compute_target_vpn_gateway:
@ -138,7 +138,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-vpngateway" name: network-vpngateway
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 }}"
@ -147,7 +147,7 @@
ignore_errors: true ignore_errors: true
- name: delete a address - name: delete a address
gcp_compute_address: gcp_compute_address:
name: "address-vpngateway" name: address-vpngateway
region: us-west1 region: us-west1
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a instance group - name: create a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-urlmap" name: instancegroup-urlmap
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -24,7 +24,7 @@
register: instancegroup register: instancegroup
- name: create a http health check - name: create a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:
name: "httphealthcheck-urlmap" name: httphealthcheck-urlmap
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -36,12 +36,12 @@
register: healthcheck register: healthcheck
- name: create a backend service - name: create a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-urlmap" name: backendservice-urlmap
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -83,7 +83,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a url map that already exists - name: create a url map that already exists
gcp_compute_url_map: gcp_compute_url_map:
@ -127,7 +127,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a url map that does not exist - name: delete a url map that does not exist
gcp_compute_url_map: gcp_compute_url_map:
@ -148,12 +148,12 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a backend service - name: delete a backend service
gcp_compute_backend_service: gcp_compute_backend_service:
name: "backendservice-urlmap" name: backendservice-urlmap
backends: backends:
- group: "{{ instancegroup }}" - group: "{{ instancegroup }}"
health_checks: health_checks:
- "{{ healthcheck.selfLink }}" - "{{ healthcheck.selfLink }}"
enable_cdn: true enable_cdn: 'true'
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 }}"
@ -162,7 +162,7 @@
ignore_errors: true 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-urlmap" name: httphealthcheck-urlmap
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
@ -175,7 +175,7 @@
ignore_errors: true ignore_errors: true
- name: delete a instance group - name: delete a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "instancegroup-urlmap" name: instancegroup-urlmap
zone: us-central1-a zone: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-vpn-tunnel" name: network-vpn-tunnel
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 }}"
@ -23,7 +23,7 @@
register: network register: network
- name: create a router - name: create a router
gcp_compute_router: gcp_compute_router:
name: "router-vpn-tunnel" name: router-vpn-tunnel
network: "{{ network }}" network: "{{ network }}"
bgp: bgp:
asn: 64514 asn: 64514
@ -41,7 +41,7 @@
register: router register: router
- name: create a target vpn gateway - name: create a target vpn gateway
gcp_compute_target_vpn_gateway: gcp_compute_target_vpn_gateway:
name: "gateway-vpn-tunnel" name: gateway-vpn-tunnel
region: us-west1 region: us-west1
network: "{{ network }}" network: "{{ network }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
@ -92,7 +92,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 1 - results['resources'] | length == 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a vpn tunnel that already exists - name: create a vpn tunnel that already exists
gcp_compute_vpn_tunnel: gcp_compute_vpn_tunnel:
@ -143,7 +143,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a vpn tunnel that does not exist - name: delete a vpn tunnel that does not exist
gcp_compute_vpn_tunnel: gcp_compute_vpn_tunnel:
@ -167,7 +167,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a target vpn gateway - name: delete a target vpn gateway
gcp_compute_target_vpn_gateway: gcp_compute_target_vpn_gateway:
name: "gateway-vpn-tunnel" name: gateway-vpn-tunnel
region: us-west1 region: us-west1
network: "{{ network }}" network: "{{ network }}"
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
@ -178,7 +178,7 @@
ignore_errors: true ignore_errors: true
- name: delete a router - name: delete a router
gcp_compute_router: gcp_compute_router:
name: "router-vpn-tunnel" name: router-vpn-tunnel
network: "{{ network }}" network: "{{ network }}"
bgp: bgp:
asn: 64514 asn: 64514
@ -197,7 +197,7 @@
ignore_errors: true ignore_errors: true
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-vpn-tunnel" name: network-vpn-tunnel
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a cluster - name: create a cluster
gcp_container_cluster: gcp_container_cluster:
name: "cluster-nodepool" name: cluster-nodepool
initial_node_count: 4 initial_node_count: 4
location: us-central1-a location: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
@ -134,7 +134,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a cluster - name: delete a cluster
gcp_container_cluster: gcp_container_cluster:
name: "cluster-nodepool" name: cluster-nodepool
initial_node_count: 4 initial_node_count: 4
location: us-central1-a location: us-central1-a
project: "{{ gcp_project }}" project: "{{ gcp_project }}"

View file

@ -1 +1,2 @@
cloud/gcp cloud/gcp
unsupported

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1 +1,2 @@
cloud/gcp cloud/gcp
unsupported

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,3 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}' sa_name: sa-{{ 100000 | random }}@graphite-playground.google.com.iam.gserviceaccount.com

View file

@ -15,9 +15,7 @@
# Pre-test setup # Pre-test setup
- name: delete a service account - name: delete a service account
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: "{{ sa_name }}"
'
display_name: My Ansible test key display_name: My Ansible test key
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -26,9 +24,7 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: create a service account - name: create a service account
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: "{{ sa_name }}"
'
display_name: My Ansible test key display_name: My Ansible test key
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -54,9 +50,7 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a service account that already exists - name: create a service account that already exists
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: "{{ sa_name }}"
'
display_name: My Ansible test key display_name: My Ansible test key
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -70,9 +64,7 @@
#---------------------------------------------------------- #----------------------------------------------------------
- name: delete a service account - name: delete a service account
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: "{{ sa_name }}"
'
display_name: My Ansible test key display_name: My Ansible test key
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"
@ -98,9 +90,7 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a service account that does not exist - name: delete a service account that does not exist
gcp_iam_service_account: gcp_iam_service_account:
name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" name: "{{ sa_name }}"
'
display_name: My Ansible test key display_name: My Ansible test key
project: "{{ gcp_project }}" project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}" auth_kind: "{{ gcp_cred_kind }}"

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a topic - name: create a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: "topic-subscription" name: topic-subscription
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 }}"
@ -119,7 +119,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a topic - name: delete a topic
gcp_pubsub_topic: gcp_pubsub_topic:
name: "topic-subscription" name: topic-subscription
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: network-instance
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 }}"
@ -161,7 +161,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a network - name: delete a network
gcp_compute_network: gcp_compute_network:
name: "network-instance" name: network-instance
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

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -15,7 +15,7 @@
# Pre-test setup # Pre-test setup
- name: create a instance - name: create a instance
gcp_spanner_instance: gcp_spanner_instance:
name: "instance-database" name: instance-database
display_name: My Spanner Instance display_name: My Spanner Instance
node_count: 2 node_count: 2
labels: labels:
@ -121,7 +121,7 @@
# If errors happen, don't crash the playbook! # If errors happen, don't crash the playbook!
- name: delete a instance - name: delete a instance
gcp_spanner_instance: gcp_spanner_instance:
name: "instance-database" name: instance-database
display_name: My Spanner Instance display_name: My Spanner Instance
node_count: 2 node_count: 2
labels: labels:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -59,7 +59,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length >= 1 - results['resources'] | length >= 1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: create a instance that already exists - name: create a instance that already exists
gcp_sql_instance: gcp_sql_instance:
@ -113,7 +113,7 @@
- name: verify that command succeeded - name: verify that command succeeded
assert: assert:
that: that:
- results['items'] | length == 0 - results['resources'] | length == 0
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
- name: delete a instance that does not exist - name: delete a instance that does not exist
gcp_sql_instance: gcp_sql_instance:

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

View file

@ -1,3 +1,2 @@
--- ---
# defaults file resource_name: "{{ resource_prefix }}"
resource_name: '{{resource_prefix}}'

Some files were not shown because too many files have changed in this diff Show more