diff --git a/lib/ansible/modules/cloud/google/gcp_compute_address.py b/lib/ansible/modules/cloud/google/gcp_compute_address.py index df536ed69198bb..9a05e01744c667 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_address.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_address.py @@ -262,7 +262,8 @@ def create(module, link, kind): def update(module, link, kind): - module.fail_json(msg="Address 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_global_address.py b/lib/ansible/modules/cloud/google/gcp_compute_global_address.py index 00bc1af38511d1..fff05fb85c921a 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_global_address.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_global_address.py @@ -217,7 +217,8 @@ def create(module, link, kind): def update(module, link, kind): - module.fail_json(msg="GlobalAddress 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_instance_template.py b/lib/ansible/modules/cloud/google/gcp_compute_instance_template.py index 566efea58dec67..71b7ab3d76acfb 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 92b951e35f2a23..b977a7a9c7df7d 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 8f62a2fe9eb433..cd80b35335d67c 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/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py index 8a4e6ae79c0486..3bb5f0abeb6787 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate.py @@ -204,7 +204,8 @@ def create(module, link, kind): def update(module, link, kind): - module.fail_json(msg="SslCertificate 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_target_vpn_gateway.py b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py index 3e26ef4634d065..9b7a9805444ba0 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_target_vpn_gateway.py @@ -222,7 +222,8 @@ def create(module, link, kind): def update(module, link, kind): - module.fail_json(msg="TargetVpnGateway 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_vpn_tunnel.py b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py index ec7be3db0500e5..1302affb83b008 100644 --- a/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py +++ b/lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py @@ -314,7 +314,8 @@ def create(module, link, kind): def update(module, link, kind): - module.fail_json(msg="VpnTunnel 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_pubsub_topic.py b/lib/ansible/modules/cloud/google/gcp_pubsub_topic.py index 5982ed0a79c070..728fc60080f3d2 100644 --- a/lib/ansible/modules/cloud/google/gcp_pubsub_topic.py +++ b/lib/ansible/modules/cloud/google/gcp_pubsub_topic.py @@ -142,7 +142,8 @@ def create(module, link): def update(module, link): - module.fail_json(msg="Topic cannot be edited") + delete(module, self_link(module)) + create(module, self_link(module)) def delete(module, link): diff --git a/lib/ansible/modules/cloud/google/gcp_sourcerepo_repository.py b/lib/ansible/modules/cloud/google/gcp_sourcerepo_repository.py index d1e1a06be437f0..8bfa22e7065772 100644 --- a/lib/ansible/modules/cloud/google/gcp_sourcerepo_repository.py +++ b/lib/ansible/modules/cloud/google/gcp_sourcerepo_repository.py @@ -142,7 +142,8 @@ def create(module, link): def update(module, link): - module.fail_json(msg="Repository cannot be edited") + delete(module, self_link(module)) + create(module, collection(module)) def delete(module, link): diff --git a/lib/ansible/modules/cloud/google/gcp_spanner_database.py b/lib/ansible/modules/cloud/google/gcp_spanner_database.py index 19306cdd6bb902..fe585a05e82acd 100644 --- a/lib/ansible/modules/cloud/google/gcp_spanner_database.py +++ b/lib/ansible/modules/cloud/google/gcp_spanner_database.py @@ -181,7 +181,8 @@ def create(module, link): def update(module, link): - module.fail_json(msg="Database cannot be edited") + delete(module, self_link(module)) + create(module, collection(module)) def delete(module, link):