Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Ansible - non-updatable resources should be deleted/created #231

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ansible/modules/cloud/google/gcp_compute_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/modules/cloud/google/gcp_compute_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/modules/cloud/google/gcp_pubsub_topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/modules/cloud/google/gcp_spanner_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down