summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py13
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py20
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py13
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py20
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py13
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_image.py40
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_image_facts.py13
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance.py98
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py15
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_group.py30
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py15
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py76
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py15
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_template.py80
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py13
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py16
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py15
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_network.py107
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_network_facts.py45
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_region_disk.py58
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py24
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_route.py32
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_route_facts.py13
23 files changed, 393 insertions, 391 deletions
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py
index 8db32afba7..fd62170023 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_health_check_facts.py
@@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a health check facts
+- name: " a health check facts"
gcp_compute_health_check_facts:
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py
index 6c20f3edee..5379eebec0 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py
@@ -105,22 +105,22 @@ options:
required: false
extends_documentation_fragment: gcp
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)'
'''
EXAMPLES = '''
- name: create a http health check
gcp_compute_http_health_check:
- name: "test_object"
- healthy_threshold: 10
- port: 8080
- timeout_sec: 2
- unhealthy_threshold: 5
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ healthy_threshold: 10
+ port: 8080
+ timeout_sec: 2
+ unhealthy_threshold: 5
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py
index 5594d91360..a1c4fe5412 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_http_health_check_facts.py
@@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a http health check facts
+- name: " a http health check facts"
gcp_compute_http_health_check_facts:
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py
index 9d75310d6a..41b496a4c4 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py
@@ -102,22 +102,22 @@ options:
required: false
extends_documentation_fragment: gcp
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)'
'''
EXAMPLES = '''
- name: create a https health check
gcp_compute_https_health_check:
- name: "test_object"
- healthy_threshold: 10
- port: 8080
- timeout_sec: 2
- unhealthy_threshold: 5
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ healthy_threshold: 10
+ port: 8080
+ timeout_sec: 2
+ unhealthy_threshold: 5
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py
index 4bd372b689..99ca9a721e 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_https_health_check_facts.py
@@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a https health check facts
+- name: " a https health check facts"
gcp_compute_https_health_check_facts:
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_image.py b/lib/ansible/modules/cloud/google/gcp_compute_image.py
index 7a1ec37526..4a8f9eb00a 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_image.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_image.py
@@ -106,11 +106,6 @@ options:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648
base64 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
labels:
description:
- Labels to apply to this Image.
@@ -173,11 +168,6 @@ options:
- Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648
base64 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
source_disk_id:
description:
- The ID value of the disk used to create this image. This value may be used to
@@ -193,29 +183,29 @@ options:
- RAW
extends_documentation_fragment: gcp
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)'
'''
EXAMPLES = '''
- name: create a disk
gcp_compute_disk:
- name: "disk-image"
- zone: us-central1-a
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: disk-image
+ zone: us-central1-a
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: disk
- name: create a image
gcp_compute_image:
- name: "test_object"
- source_disk: "{{ disk }}"
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ source_disk: "{{ disk }}"
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
@@ -453,7 +443,7 @@ def main():
disk_size_gb=dict(type='int'),
family=dict(type='str'),
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'),
licenses=dict(type='list', elements='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')),
),
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_type=dict(type='str', choices=['RAW']),
)
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_image_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_image_facts.py
index d745044c94..bcf494a7b8 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_image_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_image_facts.py
@@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a image facts
+- name: " a image facts"
gcp_compute_image_facts:
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance.py b/lib/ansible/modules/cloud/google/gcp_compute_instance.py
index 73237ad5af..1687eb9c85 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance.py
@@ -98,11 +98,6 @@ options:
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
encryption key 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
index:
description:
- 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
RFC 4648 base64 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
interface:
description:
- 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
left unspecified, the primary range of the subnetwork will be used.
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:
description:
- Specifies the title of an existing network. When creating an instance, if
@@ -424,57 +409,57 @@ extends_documentation_fragment: gcp
EXAMPLES = '''
- name: create a disk
gcp_compute_disk:
- name: "disk-instance"
- size_gb: 50
- source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
- zone: us-central1-a
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: disk-instance
+ size_gb: 50
+ source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
+ zone: us-central1-a
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: disk
- name: create a network
gcp_compute_network:
- name: "network-instance"
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: network-instance
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: network
- name: create a address
gcp_compute_address:
- name: "address-instance"
- region: us-central1
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: address-instance
+ region: us-central1
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: address
- name: create a instance
gcp_compute_instance:
- name: "test_object"
- machine_type: n1-standard-1
- disks:
- - auto_delete: true
- boot: true
- source: "{{ disk }}"
- metadata:
- startup-script-url: gs:://graphite-playground/bootstrap.sh
- cost-center: '12345'
- network_interfaces:
- - network: "{{ network }}"
- access_configs:
- - name: External NAT
- nat_ip: "{{ address }}"
- type: ONE_TO_ONE_NAT
- zone: us-central1-a
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ machine_type: n1-standard-1
+ disks:
+ - auto_delete: 'true'
+ boot: 'true'
+ source: "{{ disk }}"
+ metadata:
+ startup-script-url: gs:://graphite-playground/bootstrap.sh
+ cost-center: '12345'
+ network_interfaces:
+ - network: "{{ network }}"
+ access_configs:
+ - name: External NAT
+ nat_ip: "{{ address }}"
+ type: ONE_TO_ONE_NAT
+ zone: us-central1-a
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
@@ -902,7 +887,7 @@ def main():
auto_delete=dict(type='bool'),
boot=dict(type='bool'),
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'),
initialize_params=dict(
type='dict',
@@ -911,7 +896,7 @@ def main():
disk_size_gb=dict(type='int'),
disk_type=dict(type='str'),
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']),
@@ -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'])),
),
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_ip=dict(type='str'),
subnetwork=dict(),
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py
index 44187d879a..dbc0431292 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_facts.py
@@ -53,14 +53,15 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a instance facts
+- name: " a instance facts"
gcp_compute_instance_facts:
- zone: us-central1-a
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ zone: us-central1-a
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py
index fbbe6370dd..7c7b9d7349 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group.py
@@ -118,25 +118,25 @@ extends_documentation_fragment: gcp
EXAMPLES = '''
- name: create a network
gcp_compute_network:
- name: "network-instancegroup"
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: network-instancegroup
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: network
- name: create a instance group
gcp_compute_instance_group:
- name: "test_object"
- named_ports:
- - name: ansible
- port: 1234
- network: "{{ network }}"
- zone: us-central1-a
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ named_ports:
+ - name: ansible
+ port: 1234
+ network: "{{ network }}"
+ zone: us-central1-a
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py
index e01d250438..a875420c5d 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py
@@ -53,14 +53,15 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a instance group facts
+- name: " a instance group facts"
gcp_compute_instance_group_facts:
- zone: us-central1-a
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ zone: us-central1-a
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py
index 7c8facab90..2c9ef40210 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py
@@ -117,56 +117,56 @@ extends_documentation_fragment: gcp
EXAMPLES = '''
- name: create a network
gcp_compute_network:
- name: "network-instancetemplate"
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: network-instancetemplate
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: network
- name: create a address
gcp_compute_address:
- name: "address-instancetemplate"
- region: us-west1
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: address-instancetemplate
+ region: us-west1
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: address
- name: create a instance template
gcp_compute_instance_template:
- name: "{{ resource_name }}"
- properties:
- disks:
- - auto_delete: true
- boot: true
- initialize_params:
- source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
- machine_type: n1-standard-1
- network_interfaces:
- - network: "{{ network }}"
- access_configs:
- - name: test-config
- type: ONE_TO_ONE_NAT
- nat_ip: "{{ address }}"
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: "{{ resource_name }}"
+ properties:
+ disks:
+ - auto_delete: 'true'
+ boot: 'true'
+ initialize_params:
+ source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
+ machine_type: n1-standard-1
+ network_interfaces:
+ - network: "{{ network }}"
+ access_configs:
+ - name: test-config
+ type: ONE_TO_ONE_NAT
+ nat_ip: "{{ address }}"
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: instancetemplate
- name: create a instance group manager
gcp_compute_instance_group_manager:
- name: "test_object"
- base_instance_name: test1-child
- instance_template: "{{ instancetemplate }}"
- target_size: 3
- zone: us-west1-a
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ base_instance_name: test1-child
+ instance_template: "{{ instancetemplate }}"
+ target_size: 3
+ zone: us-west1-a
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py
index 17250efc24..0d13073cfb 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager_facts.py
@@ -53,14 +53,15 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a instance group manager facts
+- name: " a instance group manager facts"
gcp_compute_instance_group_manager_facts:
- zone: us-west1-a
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ zone: us-west1-a
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py
index 44ec013363..eebdfa5540 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py
@@ -123,11 +123,6 @@ options:
- Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied
encryption key 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
index:
description:
- 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
in RFC 4648 base64 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
interface:
description:
- 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
will be used.
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:
description:
- Specifies the title of an existing network. When creating an instance,
@@ -418,43 +403,43 @@ extends_documentation_fragment: gcp
EXAMPLES = '''
- name: create a network
gcp_compute_network:
- name: "network-instancetemplate"
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: network-instancetemplate
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: network
- name: create a address
gcp_compute_address:
- name: "address-instancetemplate"
- region: us-west1
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: address-instancetemplate
+ region: us-west1
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: address
- name: create a instance template
gcp_compute_instance_template:
- name: "test_object"
- properties:
- disks:
- - auto_delete: true
- boot: true
- initialize_params:
- source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
- machine_type: n1-standard-1
- network_interfaces:
- - network: "{{ network }}"
- access_configs:
- - name: test-config
- type: ONE_TO_ONE_NAT
- nat_ip: "{{ address }}"
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ properties:
+ disks:
+ - auto_delete: 'true'
+ boot: 'true'
+ initialize_params:
+ source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts
+ machine_type: n1-standard-1
+ network_interfaces:
+ - network: "{{ network }}"
+ access_configs:
+ - name: test-config
+ type: ONE_TO_ONE_NAT
+ nat_ip: "{{ address }}"
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
@@ -878,9 +863,7 @@ def main():
auto_delete=dict(type='bool'),
boot=dict(type='bool'),
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'),
initialize_params=dict(
type='dict',
@@ -889,7 +872,7 @@ def main():
disk_size_gb=dict(type='int'),
disk_type=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']),
@@ -916,7 +899,6 @@ def main():
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_ip=dict(type='str'),
subnetwork=dict(),
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py
index 38e264c9b4..b6f57d9aca 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_template_facts.py
@@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a instance template facts
+- name: " a instance template facts"
gcp_compute_instance_template_facts:
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py
index f4ad618e0e..025755127b 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py
@@ -119,14 +119,14 @@ extends_documentation_fragment: gcp
EXAMPLES = '''
- name: create a interconnect attachment
gcp_compute_interconnect_attachment:
- name: "test_object"
- region: us-central1
- project: "test_project"
- auth_kind: "serviceaccount"
- interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/...
- router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/...
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ region: us-central1
+ project: test_project
+ auth_kind: serviceaccount
+ interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/...
+ router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/...
+ service_account_file: "/tmp/auth.pem"
+ state: present
register: disk
'''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py
index 0e638dc73f..2d43ab07dd 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment_facts.py
@@ -53,14 +53,15 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a interconnect attachment facts
+- name: " a interconnect attachment facts"
gcp_compute_interconnect_attachment_facts:
- region: us-central1
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ region: us-central1
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_network.py b/lib/ansible/modules/cloud/google/gcp_compute_network.py
index 072c71b990..0d893b86c1 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_network.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_network.py
@@ -31,18 +31,7 @@ DOCUMENTATION = '''
---
module: gcp_compute_network
description:
-- Represents a Network resource.
-- 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.
+- Manages a VPC network or legacy network resource on GCP.
short_description: Creates a GCP Network
version_added: 2.6
author: Google Inc. (@googlecloudplatform)
@@ -60,14 +49,18 @@ options:
default: present
description:
description:
- - An optional description of this resource. Provide this property when you create
- the resource.
+ - An optional description of this resource. The resource must be recreated to
+ modify this field.
required: false
ipv4_range:
description:
- - 'The range of internal addresses that are legal on this network. This range
- is a CIDR specification, for example: 192.168.0.0/16. Provided by the client
- when the network is created.'
+ - If this field is specified, a deprecated legacy network is created.
+ - You will no longer be able to create a legacy network on Feb 1, 2020.
+ - 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
name:
description:
@@ -80,10 +73,11 @@ options:
required: true
auto_create_subnetworks:
description:
- - When set to true, the network is created in "auto subnet mode". When set to
- false, the network is in "custom subnet mode".
- - In "auto subnet mode", a newly created network is assigned the default CIDR
- of 10.128.0.0/9 and it automatically creates one subnetwork per region.
+ - When set to `true`, the network is created in "auto subnet mode" and it will
+ create a subnet for each region automatically across the `10.128.0.0/9` address
+ range.
+ - When set to `false`, the network is created in "custom subnet mode" so the user
+ can explicitly connect subnetwork resources.
required: false
type: bool
routing_config:
@@ -95,9 +89,9 @@ options:
suboptions:
routing_mode:
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
- 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
regions.
required: true
@@ -113,26 +107,25 @@ notes:
EXAMPLES = '''
- name: create a network
gcp_compute_network:
- name: "test_object"
- auto_create_subnetworks: true
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ auto_create_subnetworks: 'true'
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
description:
description:
- - An optional description of this resource. Provide this property when you create
- the resource.
+ - An optional description of this resource. The resource must be recreated to modify
+ this field.
returned: success
type: str
gateway_ipv4:
description:
- - A gateway address for default routing to other networks. This value is read only
- and is selected by the Google Compute Engine, typically as the first usable address
- in the IPv4Range.
+ - The gateway address for default routing out of the network. This value is selected
+ by GCP.
returned: success
type: str
id:
@@ -142,9 +135,13 @@ id:
type: int
ipv4_range:
description:
- - 'The range of internal addresses that are legal on this network. This range is
- a CIDR specification, for example: 192.168.0.0/16. Provided by the client when
- the network is created.'
+ - If this field is specified, a deprecated legacy network is created.
+ - You will no longer be able to create a legacy network on Feb 1, 2020.
+ - 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
type: str
name:
@@ -164,10 +161,10 @@ subnetworks:
type: list
autoCreateSubnetworks:
description:
- - When set to true, the network is created in "auto subnet mode". When set to false,
- the network is in "custom subnet mode".
- - In "auto subnet mode", a newly created network is assigned the default CIDR of
- 10.128.0.0/9 and it automatically creates one subnetwork per region.
+ - When set to `true`, the network is created in "auto subnet mode" and it will create
+ a subnet for each region automatically across the `10.128.0.0/9` address range.
+ - When set to `false`, the network is created in "custom subnet mode" so the user
+ can explicitly connect subnetwork resources.
returned: success
type: bool
creationTimestamp:
@@ -184,10 +181,11 @@ routingConfig:
contains:
routingMode:
description:
- - 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 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 regions.
+ - 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
+ 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
+ regions.
returned: success
type: str
'''
@@ -232,7 +230,7 @@ def main():
if fetch:
if state == 'present':
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)
changed = True
else:
@@ -256,9 +254,22 @@ def create(module, link, kind):
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')
- 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):
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_network_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_network_facts.py
index 6f2594ae96..3be15790b2 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_network_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_network_facts.py
@@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a network facts
+- name: " a network facts"
gcp_compute_network_facts:
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
@@ -66,15 +67,14 @@ items:
contains:
description:
description:
- - An optional description of this resource. Provide this property when you create
- the resource.
+ - An optional description of this resource. The resource must be recreated to
+ modify this field.
returned: success
type: str
gateway_ipv4:
description:
- - A gateway address for default routing to other networks. This value is read
- only and is selected by the Google Compute Engine, typically as the first
- usable address in the IPv4Range.
+ - The gateway address for default routing out of the network. This value is
+ selected by GCP.
returned: success
type: str
id:
@@ -84,9 +84,13 @@ items:
type: int
ipv4_range:
description:
- - 'The range of internal addresses that are legal on this network. This range
- is a CIDR specification, for example: 192.168.0.0/16. Provided by the client
- when the network is created.'
+ - If this field is specified, a deprecated legacy network is created.
+ - You will no longer be able to create a legacy network on Feb 1, 2020.
+ - 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
type: str
name:
@@ -106,10 +110,11 @@ items:
type: list
autoCreateSubnetworks:
description:
- - When set to true, the network is created in "auto subnet mode". When set to
- false, the network is in "custom subnet mode".
- - In "auto subnet mode", a newly created network is assigned the default CIDR
- of 10.128.0.0/9 and it automatically creates one subnetwork per region.
+ - When set to `true`, the network is created in "auto subnet mode" and it will
+ create a subnet for each region automatically across the `10.128.0.0/9` address
+ range.
+ - When set to `false`, the network is created in "custom subnet mode" so the
+ user can explicitly connect subnetwork resources.
returned: success
type: bool
creationTimestamp:
@@ -126,9 +131,9 @@ items:
contains:
routingMode:
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
- 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
regions.
returned: success
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py b/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py
index 9ea373238e..cd2500b12f 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_region_disk.py
@@ -88,6 +88,14 @@ options:
of sizeGb must not be less than the size of the sourceImage or the size of the
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
replica_zones:
description:
- 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
base64 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
source_snapshot:
description:
- 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
base64 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
extends_documentation_fragment: gcp
notes:
- 'API Reference: U(https://cloud.google.com/compute/docs/reference/rest/beta/regionDisks)'
@@ -157,18 +155,18 @@ notes:
EXAMPLES = '''
- name: create a region disk
gcp_compute_region_disk:
- name: "test_object"
- size_gb: 50
- disk_encryption_key:
- raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
- region: us-central1
- 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-b
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ size_gb: 50
+ disk_encryption_key:
+ raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
+ region: us-central1
+ 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-b
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
@@ -240,6 +238,15 @@ users:
.'
returned: success
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:
description:
- URLs of the zones where the disk should be replicated to.
@@ -342,12 +349,13 @@ def main():
licenses=dict(type='list', elements='str'),
name=dict(required=True, type='str'),
size_gb=dict(type='int'),
+ physical_block_size_bytes=dict(type='int'),
replica_zones=dict(required=True, type='list', elements='str'),
type=dict(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_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'name': module.params.get('name'),
u'sizeGb': module.params.get('size_gb'),
+ u'physicalBlockSizeBytes': module.params.get('physical_block_size_bytes'),
u'replicaZones': module.params.get('replica_zones'),
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'sizeGb': response.get(u'sizeGb'),
u'users': response.get(u'users'),
+ u'physicalBlockSizeBytes': response.get(u'physicalBlockSizeBytes'),
u'replicaZones': response.get(u'replicaZones'),
u'type': response.get(u'type'),
}
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py
index 8fd6202707..d571944e00 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_region_disk_facts.py
@@ -53,14 +53,15 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a region disk facts
+- name: " a region disk facts"
gcp_compute_region_disk_facts:
- region: us-central1
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ region: us-central1
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''
@@ -137,6 +138,15 @@ items:
.'
returned: success
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:
description:
- URLs of the zones where the disk should be replicated to.
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_route.py b/lib/ansible/modules/cloud/google/gcp_compute_route.py
index 0053d8cb26..e0b47593de 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_route.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_route.py
@@ -142,26 +142,26 @@ notes:
EXAMPLES = '''
- name: create a network
gcp_compute_network:
- name: "network-route"
- project: "{{ gcp_project }}"
- auth_kind: "{{ gcp_cred_kind }}"
- service_account_file: "{{ gcp_cred_file }}"
- state: present
+ name: network-route
+ project: "{{ gcp_project }}"
+ auth_kind: "{{ gcp_cred_kind }}"
+ service_account_file: "{{ gcp_cred_file }}"
+ state: present
register: network
- name: create a route
gcp_compute_route:
- name: "test_object"
- dest_range: 192.168.6.0/24
- next_hop_gateway: global/gateways/default-internet-gateway
- network: "{{ network }}"
- tags:
- - backends
- - databases
- project: "test_project"
- auth_kind: "serviceaccount"
- service_account_file: "/tmp/auth.pem"
- state: present
+ name: test_object
+ dest_range: 192.168.6.0/24
+ next_hop_gateway: global/gateways/default-internet-gateway
+ network: "{{ network }}"
+ tags:
+ - backends
+ - databases
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: present
'''
RETURN = '''
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_route_facts.py b/lib/ansible/modules/cloud/google/gcp_compute_route_facts.py
index 965189b252..34de7c0e6e 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_route_facts.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_route_facts.py
@@ -49,13 +49,14 @@ extends_documentation_fragment: gcp
'''
EXAMPLES = '''
-- name: a route facts
+- name: " a route facts"
gcp_compute_route_facts:
- filters:
- - name = test_object
- project: test_project
- auth_kind: serviceaccount
- service_account_file: "/tmp/auth.pem"
+ filters:
+ - name = test_object
+ project: test_project
+ auth_kind: serviceaccount
+ service_account_file: "/tmp/auth.pem"
+ state: facts
'''
RETURN = '''