Skip to content
Open
Changes from 2 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
6 changes: 5 additions & 1 deletion plugins/modules/gcp_compute_subnetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
import json
import time


################################################################################
# Main
################################################################################
Expand Down Expand Up @@ -353,7 +354,10 @@ def main():

if fetch:
if state == 'present':
if is_different(module, fetch):
if module.params['network']['selfLink'] != fetch['network']: # found difference on same subnet within the same VPC network
module.fail_json(msg="Subnet already exists in a different VPC network: %s, please change the name or region" % fetch['network'])
changed = False
elif is_different(module, fetch):
update(module, self_link(module), kind, fetch)
fetch = fetch_resource(module, self_link(module), kind)
changed = True
Expand Down