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 566efea58de..71b7ab3d76a 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 92b951e35f2..b977a7a9c7d 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 8f62a2fe9eb..cd80b35335d 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 aa87a2a8e0e..ba66644fc1c 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 }}"