mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Return resource objects from OpenStack modules
It's not uncommon for people to want to do additional things after creating a module. Also, add a note about it to the dev notes.
This commit is contained in:
@@ -227,7 +227,7 @@ def main():
|
||||
dns_nameservers=dns,
|
||||
allocation_pools=pool,
|
||||
host_routes=host_routes)
|
||||
module.exit_json(changed=True, result="created")
|
||||
changed = True
|
||||
else:
|
||||
if _needs_update(subnet, module):
|
||||
cloud.update_subnet(subnet['id'],
|
||||
@@ -237,16 +237,18 @@ def main():
|
||||
dns_nameservers=dns,
|
||||
allocation_pools=pool,
|
||||
host_routes=host_routes)
|
||||
module.exit_json(changed=True, result="updated")
|
||||
changed = True
|
||||
else:
|
||||
module.exit_json(changed=False, result="success")
|
||||
changed = False
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
elif state == 'absent':
|
||||
if not subnet:
|
||||
module.exit_json(changed=False, result="success")
|
||||
changed = False
|
||||
else:
|
||||
changed = True
|
||||
cloud.delete_subnet(subnet_name)
|
||||
module.exit_json(changed=True, result="deleted")
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
except shade.OpenStackCloudException as e:
|
||||
module.fail_json(msg=e.message)
|
||||
|
||||
Reference in New Issue
Block a user