mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-06 02:40:29 -07:00
Magic Modules changes. (#97)
Ensure that Ansible always returns full resource after update + no op
This commit is contained in:
parent
a53ccea09f
commit
6aa571c1b8
43 changed files with 31 additions and 105 deletions
|
@ -240,8 +240,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -208,8 +208,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -679,7 +679,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -690,8 +690,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -436,7 +436,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -446,8 +447,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -566,8 +566,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -454,7 +454,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -464,8 +465,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -192,7 +192,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -202,8 +203,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -421,8 +421,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -622,8 +622,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -249,8 +249,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -246,8 +246,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -470,8 +470,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -945,7 +945,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -956,8 +956,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
if fetch:
|
||||
instance = InstancePower(module, fetch.get('status'))
|
||||
|
|
|
@ -249,8 +249,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
if fetch:
|
||||
instance = InstanceLogic(module)
|
||||
|
|
|
@ -371,8 +371,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -924,8 +924,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -222,8 +222,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -287,7 +287,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind)
|
||||
update(module, self_link(module), kind)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -297,8 +298,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -301,8 +301,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -200,8 +200,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -237,8 +237,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -265,7 +265,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -275,8 +276,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -205,7 +205,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -215,8 +216,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -278,7 +278,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -288,8 +289,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -284,8 +284,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -263,7 +263,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -273,8 +274,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -214,7 +214,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -224,8 +225,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -207,8 +207,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -420,8 +420,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -300,7 +300,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind)
|
||||
|
@ -311,8 +312,6 @@ def main():
|
|||
fetch = create(module, collection(module), kind)
|
||||
labels_update(module, module.params, fetch)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -660,8 +660,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module))
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -488,8 +488,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module))
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
|
@ -215,8 +215,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -189,7 +189,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind, fetch)
|
||||
|
@ -199,8 +200,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
update(module, self_link(module), fetch)
|
||||
update(module, self_link(module))
|
||||
fetch = fetch_resource(module, self_link(module))
|
||||
changed = True
|
||||
else:
|
||||
|
@ -258,8 +258,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, self_link(module))
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -128,8 +128,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, self_link(module))
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -167,8 +167,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module))
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -194,8 +194,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module))
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -168,8 +168,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -668,7 +668,8 @@ def main():
|
|||
if fetch:
|
||||
if state == 'present':
|
||||
if is_different(module, fetch):
|
||||
fetch = update(module, self_link(module), kind, fetch)
|
||||
update(module, self_link(module), kind, fetch)
|
||||
fetch = fetch_resource(module, self_link(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
delete(module, self_link(module), kind, fetch)
|
||||
|
@ -678,8 +679,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -176,8 +176,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -832,8 +832,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
|
@ -239,8 +239,6 @@ def main():
|
|||
if state == 'present':
|
||||
fetch = create(module, collection(module), kind)
|
||||
changed = True
|
||||
else:
|
||||
fetch = {}
|
||||
|
||||
fetch.update({'changed': changed})
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue