summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Magician <magic-modules@google.com>2019-04-29 12:50:54 -0700
committeransibot <ansibot@users.noreply.github.com>2019-04-29 15:50:53 -0400
commit50b72ec2b5455aefdb22e4ee351a83a50722932c (patch)
tree12b89864690071a3b497572e2f028d6a315d299a
parent619365860806de6acfe4a593f8912aa4bd05857e (diff)
downloadansible-50b72ec2b5455aefdb22e4ee351a83a50722932c.tar.gz
Bug fixes for GCP modules (#55359)
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_instance_template.py3
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py3
-rw-r--r--lib/ansible/modules/cloud/google/gcp_compute_route.py3
-rw-r--r--test/integration/targets/gcp_compute_http_health_check/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_https_health_check/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_image/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_instance/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_instance_group/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_instance_template/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_network/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_region_disk/defaults/main.yml3
-rw-r--r--test/integration/targets/gcp_compute_route/defaults/main.yml3
13 files changed, 16 insertions, 23 deletions
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 566efea58d..71b7ab3d76 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py
@@ -953,7 +953,8 @@ def create(module, link, kind):
def update(module, link, kind):
- module.fail_json(msg="InstanceTemplate cannot be edited")
+ delete(module, self_link(module), kind)
+ create(module, collection(module), kind)
def delete(module, link, kind):
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 92b951e35f..b977a7a9c7 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py
@@ -328,7 +328,8 @@ def create(module, link, kind):
def update(module, link, kind):
- module.fail_json(msg="InterconnectAttachment cannot be edited")
+ delete(module, self_link(module), kind)
+ create(module, collection(module), kind)
def delete(module, link, kind):
diff --git a/lib/ansible/modules/cloud/google/gcp_compute_route.py b/lib/ansible/modules/cloud/google/gcp_compute_route.py
index 8f62a2fe9e..cd80b35335 100644
--- a/lib/ansible/modules/cloud/google/gcp_compute_route.py
+++ b/lib/ansible/modules/cloud/google/gcp_compute_route.py
@@ -312,7 +312,8 @@ def create(module, link, kind):
def update(module, link, kind):
- module.fail_json(msg="Route cannot be edited")
+ delete(module, self_link(module), kind)
+ create(module, collection(module), kind)
def delete(module, link, kind):
diff --git a/test/integration/targets/gcp_compute_http_health_check/defaults/main.yml b/test/integration/targets/gcp_compute_http_health_check/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_http_health_check/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_http_health_check/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_https_health_check/defaults/main.yml b/test/integration/targets/gcp_compute_https_health_check/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_https_health_check/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_https_health_check/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_image/defaults/main.yml b/test/integration/targets/gcp_compute_image/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_image/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_image/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_instance/defaults/main.yml b/test/integration/targets/gcp_compute_instance/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_instance/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_instance/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_instance_group/defaults/main.yml b/test/integration/targets/gcp_compute_instance_group/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_instance_group/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_instance_group/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml b/test/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_instance_template/defaults/main.yml b/test/integration/targets/gcp_compute_instance_template/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_instance_template/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_instance_template/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_network/defaults/main.yml b/test/integration/targets/gcp_compute_network/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_network/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_network/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_region_disk/defaults/main.yml b/test/integration/targets/gcp_compute_region_disk/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_region_disk/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_region_disk/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"
diff --git a/test/integration/targets/gcp_compute_route/defaults/main.yml b/test/integration/targets/gcp_compute_route/defaults/main.yml
index aa87a2a8e0..ba66644fc1 100644
--- a/test/integration/targets/gcp_compute_route/defaults/main.yml
+++ b/test/integration/targets/gcp_compute_route/defaults/main.yml
@@ -1,3 +1,2 @@
---
-# defaults file
-resource_name: '{{resource_prefix}}'
+resource_name: "{{ resource_prefix }}"