Bug fixes for GCP modules (#53879)

This commit is contained in:
The Magician 2019-03-15 14:38:27 -07:00 committed by ansibot
parent e8e69bf069
commit b429ba61dc
33 changed files with 1093 additions and 1091 deletions

View file

@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a health check facts - name: " a health check facts"
gcp_compute_health_check_facts: gcp_compute_health_check_facts:
filters: filters:
- name = test_object - name = test_object
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 = '''

View file

@ -105,20 +105,20 @@ options:
required: false required: false
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks)' - 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks)'
- 'Adding Health Checks: U(https://cloud.google.com/compute/docs/load-balancing/health-checks#legacy_health_checks)' - 'Adding Health Checks: U(https://cloud.google.com/compute/docs/load-balancing/health-checks#legacy_health_checks)'
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: create a http health check - name: create a http health check
gcp_compute_http_health_check: gcp_compute_http_health_check:
name: "test_object" name: test_object
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
unhealthy_threshold: 5 unhealthy_threshold: 5
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
''' '''

View file

@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a http health check facts - name: " a http health check facts"
gcp_compute_http_health_check_facts: gcp_compute_http_health_check_facts:
filters: filters:
- name = test_object - name = test_object
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 = '''

View file

@ -102,20 +102,20 @@ options:
required: false required: false
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/httpsHealthChecks)' - 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks)'
- 'Adding Health Checks: U(https://cloud.google.com/compute/docs/load-balancing/health-checks#legacy_health_checks)' - 'Adding Health Checks: U(https://cloud.google.com/compute/docs/load-balancing/health-checks#legacy_health_checks)'
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: create a https health check - name: create a https health check
gcp_compute_https_health_check: gcp_compute_https_health_check:
name: "test_object" name: test_object
healthy_threshold: 10 healthy_threshold: 10
port: 8080 port: 8080
timeout_sec: 2 timeout_sec: 2
unhealthy_threshold: 5 unhealthy_threshold: 5
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
''' '''

View file

@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a https health check facts - name: " a https health check facts"
gcp_compute_https_health_check_facts: gcp_compute_https_health_check_facts:
filters: filters:
- name = test_object - name = test_object
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 = '''

View file

@ -106,11 +106,6 @@ options:
- 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 to either encrypt or decrypt this resource. base64 to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption
key that protects this resource.
required: false
labels: labels:
description: description:
- Labels to apply to this Image. - Labels to apply to this Image.
@ -173,11 +168,6 @@ options:
- 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 to either encrypt or decrypt this resource. base64 to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption
key that protects this resource.
required: false
source_disk_id: source_disk_id:
description: description:
- The ID value of the disk used to create this image. This value may be used to - The ID value of the disk used to create this image. This value may be used to
@ -193,14 +183,14 @@ options:
- RAW - RAW
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
notes: notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/latest/images)' - 'API Reference: U(https://cloud.google.com/compute/docs/reference/v1/images)'
- 'Official Documentation: U(https://cloud.google.com/compute/docs/images)' - 'Official Documentation: U(https://cloud.google.com/compute/docs/images)'
''' '''
EXAMPLES = ''' EXAMPLES = '''
- 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 }}"
@ -210,10 +200,10 @@ EXAMPLES = '''
- name: create a image - name: create a image
gcp_compute_image: gcp_compute_image:
name: "test_object" name: test_object
source_disk: "{{ disk }}" source_disk: "{{ disk }}"
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
''' '''
@ -453,7 +443,7 @@ def main():
disk_size_gb=dict(type='int'), disk_size_gb=dict(type='int'),
family=dict(type='str'), family=dict(type='str'),
guest_os_features=dict(type='list', elements='dict', options=dict(type=dict(type='str', choices=['VIRTIO_SCSI_MULTIQUEUE']))), guest_os_features=dict(type='list', elements='dict', options=dict(type=dict(type='str', choices=['VIRTIO_SCSI_MULTIQUEUE']))),
image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'))), image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
labels=dict(type='dict'), labels=dict(type='dict'),
licenses=dict(type='list', elements='str'), licenses=dict(type='list', elements='str'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
@ -462,7 +452,7 @@ def main():
options=dict(container_type=dict(type='str', choices=['TAR']), sha1_checksum=dict(type='str'), source=dict(required=True, type='str')), options=dict(container_type=dict(type='str', choices=['TAR']), sha1_checksum=dict(type='str'), source=dict(required=True, type='str')),
), ),
source_disk=dict(), source_disk=dict(),
source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'))), source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
source_disk_id=dict(type='str'), source_disk_id=dict(type='str'),
source_type=dict(type='str', choices=['RAW']), source_type=dict(type='str', choices=['RAW']),
) )

View file

@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a image facts - name: " a image facts"
gcp_compute_image_facts: gcp_compute_image_facts:
filters: filters:
- name = test_object - name = test_object
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 = '''

View file

@ -98,11 +98,6 @@ options:
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied - Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
encryption key to either encrypt or decrypt this resource. encryption key to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption
key that protects this resource.
required: false
index: index:
description: description:
- Assigns a zero-based index to this disk, where 0 is reserved for the boot - Assigns a zero-based index to this disk, where 0 is reserved for the boot
@ -156,11 +151,6 @@ options:
- Specifies a 256-bit customer-supplied encryption key, encoded in - Specifies a 256-bit customer-supplied encryption key, encoded in
RFC 4648 base64 to either encrypt or decrypt this resource. RFC 4648 base64 to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
encryption key that protects this resource.
required: false
interface: interface:
description: description:
- Specifies the disk interface to use for attaching this disk, which is either - Specifies the disk interface to use for attaching this disk, which is either
@ -302,11 +292,6 @@ options:
from which to allocate the IP CIDR range for this alias IP range. If from which to allocate the IP CIDR range for this alias IP range. If
left unspecified, the primary range of the subnetwork will be used. left unspecified, the primary range of the subnetwork will be used.
required: false required: false
name:
description:
- The name of the network interface, generated by the server. For network
devices, these are eth0, eth1, etc .
required: false
network: network:
description: description:
- Specifies the title of an existing network. When creating an instance, if - Specifies the title of an existing network. When creating an instance, if
@ -424,7 +409,7 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- 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
@ -436,7 +421,7 @@ EXAMPLES = '''
- 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 }}"
@ -445,7 +430,7 @@ EXAMPLES = '''
- 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 }}"
@ -455,11 +440,11 @@ EXAMPLES = '''
- name: create a instance - name: create a instance
gcp_compute_instance: gcp_compute_instance:
name: "test_object" name: test_object
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
@ -471,8 +456,8 @@ EXAMPLES = '''
nat_ip: "{{ address }}" nat_ip: "{{ address }}"
type: ONE_TO_ONE_NAT type: ONE_TO_ONE_NAT
zone: us-central1-a zone: us-central1-a
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
''' '''
@ -902,7 +887,7 @@ def main():
auto_delete=dict(type='bool'), auto_delete=dict(type='bool'),
boot=dict(type='bool'), boot=dict(type='bool'),
device_name=dict(type='str'), device_name=dict(type='str'),
disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'), sha256=dict(type='str'))), disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'))),
index=dict(type='int'), index=dict(type='int'),
initialize_params=dict( initialize_params=dict(
type='dict', type='dict',
@ -911,7 +896,7 @@ def main():
disk_size_gb=dict(type='int'), disk_size_gb=dict(type='int'),
disk_type=dict(type='str'), disk_type=dict(type='str'),
source_image=dict(type='str', aliases=['image', 'image_family']), source_image=dict(type='str', aliases=['image', 'image_family']),
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'))), source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
), ),
), ),
interface=dict(type='str', choices=['SCSI', 'NVME']), interface=dict(type='str', choices=['SCSI', 'NVME']),
@ -936,7 +921,6 @@ def main():
options=dict(name=dict(required=True, type='str'), nat_ip=dict(), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])), options=dict(name=dict(required=True, type='str'), nat_ip=dict(), type=dict(required=True, type='str', choices=['ONE_TO_ONE_NAT'])),
), ),
alias_ip_ranges=dict(type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))), alias_ip_ranges=dict(type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))),
name=dict(type='str'),
network=dict(), network=dict(),
network_ip=dict(type='str'), network_ip=dict(type='str'),
subnetwork=dict(), subnetwork=dict(),

View file

@ -53,7 +53,7 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a instance facts - name: " a instance facts"
gcp_compute_instance_facts: gcp_compute_instance_facts:
zone: us-central1-a zone: us-central1-a
filters: filters:
@ -61,6 +61,7 @@ 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 = '''

View file

@ -118,7 +118,7 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- 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 }}"
@ -127,14 +127,14 @@ EXAMPLES = '''
- name: create a instance group - name: create a instance group
gcp_compute_instance_group: gcp_compute_instance_group:
name: "test_object" name: test_object
named_ports: named_ports:
- name: ansible - name: ansible
port: 1234 port: 1234
network: "{{ network }}" network: "{{ network }}"
zone: us-central1-a zone: us-central1-a
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
''' '''

View file

@ -53,7 +53,7 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a instance group facts - name: " a instance group facts"
gcp_compute_instance_group_facts: gcp_compute_instance_group_facts:
zone: us-central1-a zone: us-central1-a
filters: filters:
@ -61,6 +61,7 @@ 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 = '''

View file

@ -117,7 +117,7 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- 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 }}"
@ -126,7 +126,7 @@ EXAMPLES = '''
- 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 }}"
@ -139,8 +139,8 @@ EXAMPLES = '''
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,13 +158,13 @@ EXAMPLES = '''
- name: create a instance group manager - name: create a instance group manager
gcp_compute_instance_group_manager: gcp_compute_instance_group_manager:
name: "test_object" name: test_object
base_instance_name: test1-child base_instance_name: test1-child
instance_template: "{{ instancetemplate }}" instance_template: "{{ instancetemplate }}"
target_size: 3 target_size: 3
zone: us-west1-a zone: us-west1-a
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
''' '''

View file

@ -53,7 +53,7 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a instance group manager facts - name: " a instance group manager facts"
gcp_compute_instance_group_manager_facts: gcp_compute_instance_group_manager_facts:
zone: us-west1-a zone: us-west1-a
filters: filters:
@ -61,6 +61,7 @@ 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 = '''

View file

@ -123,11 +123,6 @@ options:
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied - Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
encryption key to either encrypt or decrypt this resource. encryption key to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
encryption key that protects this resource.
required: false
index: index:
description: description:
- Assigns a zero-based index to this disk, where 0 is reserved for the - Assigns a zero-based index to this disk, where 0 is reserved for the
@ -179,11 +174,6 @@ options:
- Specifies a 256-bit customer-supplied encryption key, encoded - Specifies a 256-bit customer-supplied encryption key, encoded
in RFC 4648 base64 to either encrypt or decrypt this resource. in RFC 4648 base64 to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
encryption key that protects this resource.
required: false
interface: interface:
description: description:
- Specifies the disk interface to use for attaching this disk, which is - Specifies the disk interface to use for attaching this disk, which is
@ -315,11 +305,6 @@ options:
range. If left unspecified, the primary range of the subnetwork range. If left unspecified, the primary range of the subnetwork
will be used. will be used.
required: false required: false
name:
description:
- The name of the network interface, generated by the server. For network
devices, these are eth0, eth1, etc .
required: false
network: network:
description: description:
- Specifies the title of an existing network. When creating an instance, - Specifies the title of an existing network. When creating an instance,
@ -418,7 +403,7 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- 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 }}"
@ -427,7 +412,7 @@ EXAMPLES = '''
- 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 }}"
@ -437,11 +422,11 @@ EXAMPLES = '''
- name: create a instance template - name: create a instance template
gcp_compute_instance_template: gcp_compute_instance_template:
name: "test_object" name: test_object
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
@ -451,8 +436,8 @@ EXAMPLES = '''
- name: test-config - name: test-config
type: ONE_TO_ONE_NAT type: ONE_TO_ONE_NAT
nat_ip: "{{ address }}" nat_ip: "{{ address }}"
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
''' '''
@ -878,9 +863,7 @@ def main():
auto_delete=dict(type='bool'), auto_delete=dict(type='bool'),
boot=dict(type='bool'), boot=dict(type='bool'),
device_name=dict(type='str'), device_name=dict(type='str'),
disk_encryption_key=dict( disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'))),
type='dict', options=dict(raw_key=dict(type='str'), rsa_encrypted_key=dict(type='str'), sha256=dict(type='str'))
),
index=dict(type='int'), index=dict(type='int'),
initialize_params=dict( initialize_params=dict(
type='dict', type='dict',
@ -889,7 +872,7 @@ def main():
disk_size_gb=dict(type='int'), disk_size_gb=dict(type='int'),
disk_type=dict(type='str'), disk_type=dict(type='str'),
source_image=dict(type='str'), source_image=dict(type='str'),
source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'))), source_image_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
), ),
), ),
interface=dict(type='str', choices=['SCSI', 'NVME']), interface=dict(type='str', choices=['SCSI', 'NVME']),
@ -916,7 +899,6 @@ def main():
alias_ip_ranges=dict( alias_ip_ranges=dict(
type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str')) type='list', elements='dict', options=dict(ip_cidr_range=dict(type='str'), subnetwork_range_name=dict(type='str'))
), ),
name=dict(type='str'),
network=dict(), network=dict(),
network_ip=dict(type='str'), network_ip=dict(type='str'),
subnetwork=dict(), subnetwork=dict(),

View file

@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a instance template facts - name: " a instance template facts"
gcp_compute_instance_template_facts: gcp_compute_instance_template_facts:
filters: filters:
- name = test_object - name = test_object
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 = '''

View file

@ -119,10 +119,10 @@ extends_documentation_fragment: gcp
EXAMPLES = ''' EXAMPLES = '''
- name: create a interconnect attachment - name: create a interconnect attachment
gcp_compute_interconnect_attachment: gcp_compute_interconnect_attachment:
name: "test_object" name: test_object
region: us-central1 region: us-central1
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/... interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/...
router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/... router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/...
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"

View file

@ -53,7 +53,7 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a interconnect attachment facts - name: " a interconnect attachment facts"
gcp_compute_interconnect_attachment_facts: gcp_compute_interconnect_attachment_facts:
region: us-central1 region: us-central1
filters: filters:
@ -61,6 +61,7 @@ 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 = '''

View file

@ -31,18 +31,7 @@ DOCUMENTATION = '''
--- ---
module: gcp_compute_network module: gcp_compute_network
description: description:
- Represents a Network resource. - Manages a VPC network or legacy network resource on GCP.
- Your Cloud Platform Console project can contain multiple networks, and each network
can have multiple instances attached to it. A network allows you to define a gateway
IP and the network range for the instances attached to that network. Every project
is provided with a default network with preset configurations and firewall rules.
You can choose to customize the default network by adding or removing rules, or
you can create new networks in that project. Generally, most users only need one
network, although you can have up to five networks per project by default.
- A network belongs to only one project, and each instance can only belong to one
network. All Compute Engine networks use the IPv4 protocol. Compute Engine currently
does not support IPv6. However, Google is a major advocate of IPv6 and it is an
important future direction.
short_description: Creates a GCP Network short_description: Creates a GCP Network
version_added: 2.6 version_added: 2.6
author: Google Inc. (@googlecloudplatform) author: Google Inc. (@googlecloudplatform)
@ -60,14 +49,18 @@ options:
default: present default: present
description: description:
description: description:
- An optional description of this resource. Provide this property when you create - An optional description of this resource. The resource must be recreated to
the resource. modify this field.
required: false required: false
ipv4_range: ipv4_range:
description: description:
- 'The range of internal addresses that are legal on this network. This range - If this field is specified, a deprecated legacy network is created.
is a CIDR specification, for example: 192.168.0.0/16. Provided by the client - You will no longer be able to create a legacy network on Feb 1, 2020.
when the network is created.' - See the [legacy network docs](U(https://cloud.google.com/vpc/docs/legacy)) for
more details.
- The range of internal addresses that are legal on this legacy network.
- 'This range is a CIDR specification, for example: `192.168.0.0/16`.'
- The resource must be recreated to modify this field.
required: false required: false
name: name:
description: description:
@ -80,10 +73,11 @@ options:
required: true required: true
auto_create_subnetworks: auto_create_subnetworks:
description: description:
- When set to true, the network is created in "auto subnet mode". When set to - When set to `true`, the network is created in "auto subnet mode" and it will
false, the network is in "custom subnet mode". create a subnet for each region automatically across the `10.128.0.0/9` address
- In "auto subnet mode", a newly created network is assigned the default CIDR range.
of 10.128.0.0/9 and it automatically creates one subnetwork per region. - When set to `false`, the network is created in "custom subnet mode" so the user
can explicitly connect subnetwork resources.
required: false required: false
type: bool type: bool
routing_config: routing_config:
@ -95,9 +89,9 @@ options:
suboptions: suboptions:
routing_mode: routing_mode:
description: description:
- The network-wide routing mode to use. If set to REGIONAL, this network's - The network-wide routing mode to use. If set to `REGIONAL`, this network's
cloud routers will only advertise routes with subnetworks of this network cloud routers will only advertise routes with subnetworks of this network
in the same region as the router. If set to GLOBAL, this network's cloud in the same region as the router. If set to `GLOBAL`, this network's cloud
routers will advertise routes with all subnetworks of this network, across routers will advertise routes with all subnetworks of this network, across
regions. regions.
required: true required: true
@ -113,10 +107,10 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- name: create a network - name: create a network
gcp_compute_network: gcp_compute_network:
name: "test_object" name: test_object
auto_create_subnetworks: true auto_create_subnetworks: 'true'
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
''' '''
@ -124,15 +118,14 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
description: description:
description: description:
- An optional description of this resource. Provide this property when you create - An optional description of this resource. The resource must be recreated to modify
the resource. this field.
returned: success returned: success
type: str type: str
gateway_ipv4: gateway_ipv4:
description: description:
- A gateway address for default routing to other networks. This value is read only - The gateway address for default routing out of the network. This value is selected
and is selected by the Google Compute Engine, typically as the first usable address by GCP.
in the IPv4Range.
returned: success returned: success
type: str type: str
id: id:
@ -142,9 +135,13 @@ id:
type: int type: int
ipv4_range: ipv4_range:
description: description:
- 'The range of internal addresses that are legal on this network. This range is - If this field is specified, a deprecated legacy network is created.
a CIDR specification, for example: 192.168.0.0/16. Provided by the client when - You will no longer be able to create a legacy network on Feb 1, 2020.
the network is created.' - See the [legacy network docs](U(https://cloud.google.com/vpc/docs/legacy)) for
more details.
- The range of internal addresses that are legal on this legacy network.
- 'This range is a CIDR specification, for example: `192.168.0.0/16`.'
- The resource must be recreated to modify this field.
returned: success returned: success
type: str type: str
name: name:
@ -164,10 +161,10 @@ subnetworks:
type: list type: list
autoCreateSubnetworks: autoCreateSubnetworks:
description: description:
- When set to true, the network is created in "auto subnet mode". When set to false, - When set to `true`, the network is created in "auto subnet mode" and it will create
the network is in "custom subnet mode". a subnet for each region automatically across the `10.128.0.0/9` address range.
- In "auto subnet mode", a newly created network is assigned the default CIDR of - When set to `false`, the network is created in "custom subnet mode" so the user
10.128.0.0/9 and it automatically creates one subnetwork per region. can explicitly connect subnetwork resources.
returned: success returned: success
type: bool type: bool
creationTimestamp: creationTimestamp:
@ -184,10 +181,11 @@ routingConfig:
contains: contains:
routingMode: routingMode:
description: description:
- The network-wide routing mode to use. If set to REGIONAL, this network's cloud - The network-wide routing mode to use. If set to `REGIONAL`, this network's
routers will only advertise routes with subnetworks of this network in the cloud routers will only advertise routes with subnetworks of this network
same region as the router. If set to GLOBAL, this network's cloud routers in the same region as the router. If set to `GLOBAL`, this network's cloud
will advertise routes with all subnetworks of this network, across regions. routers will advertise routes with all subnetworks of this network, across
regions.
returned: success returned: success
type: str type: str
''' '''
@ -232,7 +230,7 @@ def main():
if fetch: if fetch:
if state == 'present': if state == 'present':
if is_different(module, fetch): if is_different(module, fetch):
update(module, self_link(module), kind) update(module, self_link(module), kind, fetch)
fetch = fetch_resource(module, self_link(module), kind) fetch = fetch_resource(module, self_link(module), kind)
changed = True changed = True
else: else:
@ -256,9 +254,22 @@ def create(module, link, kind):
return wait_for_operation(module, auth.post(link, resource_to_request(module))) return wait_for_operation(module, auth.post(link, resource_to_request(module)))
def update(module, link, kind): def update(module, link, kind, fetch):
update_fields(module, resource_to_request(module), response_to_hash(module, fetch))
return fetch_resource(module, self_link(module), kind)
def update_fields(module, request, response):
if response.get('routingConfig') != request.get('routingConfig'):
routing_config_update(module, request, response)
def routing_config_update(module, request, response):
auth = GcpSession(module, 'compute') auth = GcpSession(module, 'compute')
return wait_for_operation(module, auth.patch(link, resource_to_request(module))) auth.patch(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/networks/{name}"]).format(**module.params),
{u'routingConfig': NetworkRoutingconfig(module.params.get('routing_config', {}), module).to_request()},
)
def delete(module, link, kind): def delete(module, link, kind):

View file

@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a network facts - name: " a network facts"
gcp_compute_network_facts: gcp_compute_network_facts:
filters: filters:
- name = test_object - name = test_object
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 = '''
@ -66,15 +67,14 @@ items:
contains: contains:
description: description:
description: description:
- An optional description of this resource. Provide this property when you create - An optional description of this resource. The resource must be recreated to
the resource. modify this field.
returned: success returned: success
type: str type: str
gateway_ipv4: gateway_ipv4:
description: description:
- A gateway address for default routing to other networks. This value is read - The gateway address for default routing out of the network. This value is
only and is selected by the Google Compute Engine, typically as the first selected by GCP.
usable address in the IPv4Range.
returned: success returned: success
type: str type: str
id: id:
@ -84,9 +84,13 @@ items:
type: int type: int
ipv4_range: ipv4_range:
description: description:
- 'The range of internal addresses that are legal on this network. This range - If this field is specified, a deprecated legacy network is created.
is a CIDR specification, for example: 192.168.0.0/16. Provided by the client - You will no longer be able to create a legacy network on Feb 1, 2020.
when the network is created.' - See the [legacy network docs](U(https://cloud.google.com/vpc/docs/legacy))
for more details.
- The range of internal addresses that are legal on this legacy network.
- 'This range is a CIDR specification, for example: `192.168.0.0/16`.'
- The resource must be recreated to modify this field.
returned: success returned: success
type: str type: str
name: name:
@ -106,10 +110,11 @@ items:
type: list type: list
autoCreateSubnetworks: autoCreateSubnetworks:
description: description:
- When set to true, the network is created in "auto subnet mode". When set to - When set to `true`, the network is created in "auto subnet mode" and it will
false, the network is in "custom subnet mode". create a subnet for each region automatically across the `10.128.0.0/9` address
- In "auto subnet mode", a newly created network is assigned the default CIDR range.
of 10.128.0.0/9 and it automatically creates one subnetwork per region. - When set to `false`, the network is created in "custom subnet mode" so the
user can explicitly connect subnetwork resources.
returned: success returned: success
type: bool type: bool
creationTimestamp: creationTimestamp:
@ -126,9 +131,9 @@ items:
contains: contains:
routingMode: routingMode:
description: description:
- The network-wide routing mode to use. If set to REGIONAL, this network's - The network-wide routing mode to use. If set to `REGIONAL`, this network's
cloud routers will only advertise routes with subnetworks of this network cloud routers will only advertise routes with subnetworks of this network
in the same region as the router. If set to GLOBAL, this network's cloud in the same region as the router. If set to `GLOBAL`, this network's cloud
routers will advertise routes with all subnetworks of this network, across routers will advertise routes with all subnetworks of this network, across
regions. regions.
returned: success returned: success

View file

@ -88,6 +88,14 @@ options:
of sizeGb must not be less than the size of the sourceImage or the size of the of sizeGb must not be less than the size of the sourceImage or the size of the
snapshot. snapshot.
required: false 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
replica_zones: replica_zones:
description: description:
- URLs of the zones where the disk should be replicated to. - URLs of the zones where the disk should be replicated to.
@ -118,11 +126,6 @@ options:
- 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 to either encrypt or decrypt this resource. base64 to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption
key that protects this resource.
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
@ -143,11 +146,6 @@ options:
- 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 to either encrypt or decrypt this resource. base64 to either encrypt or decrypt this resource.
required: false required: false
sha256:
description:
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption
key that protects this resource.
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)'
@ -157,7 +155,7 @@ notes:
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=
@ -165,8 +163,8 @@ EXAMPLES = '''
replica_zones: replica_zones:
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a
- https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''
@ -240,6 +238,15 @@ 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.
@ -342,12 +349,13 @@ 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'), sha256=dict(type='str'))), disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
source_snapshot=dict(), source_snapshot=dict(),
source_snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'), sha256=dict(type='str'))), source_snapshot_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
) )
) )
@ -430,6 +438,7 @@ def resource_to_request(module):
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),
} }
@ -508,6 +517,7 @@ 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'),
} }

View file

@ -53,7 +53,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,6 +61,7 @@ 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 = '''
@ -137,6 +138,15 @@ items:
.' .'
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.

View file

@ -142,7 +142,7 @@ notes:
EXAMPLES = ''' EXAMPLES = '''
- 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 }}"
@ -151,15 +151,15 @@ EXAMPLES = '''
- name: create a route - name: create a route
gcp_compute_route: gcp_compute_route:
name: "test_object" name: test_object
dest_range: 192.168.6.0/24 dest_range: 192.168.6.0/24
next_hop_gateway: global/gateways/default-internet-gateway next_hop_gateway: global/gateways/default-internet-gateway
network: "{{ network }}" network: "{{ network }}"
tags: tags:
- backends - backends
- databases - databases
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
''' '''

View file

@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: a route facts - name: " a route facts"
gcp_compute_route_facts: gcp_compute_route_facts:
filters: filters:
- name = test_object - name = test_object
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 = '''

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 }}"
@ -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

@ -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
@ -113,8 +113,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
@ -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
@ -186,8 +186,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
@ -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

@ -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 }}"
@ -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

@ -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
@ -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

@ -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
@ -97,8 +97,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
@ -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
@ -165,8 +165,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 @@
# 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

@ -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 }}"
@ -54,7 +54,7 @@
- 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 }}"
@ -98,7 +98,7 @@
- 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

@ -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 }}"
@ -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 }}"