Return the secgroup for all present states
This commit is contained in:
parent
ef22008cac
commit
1a11f07d29
1 changed files with 5 additions and 6 deletions
|
@ -115,18 +115,17 @@ def main():
|
|||
module.exit_json(changed=_system_state_change(module, secgroup))
|
||||
|
||||
if state == 'present':
|
||||
changed = False
|
||||
if not secgroup:
|
||||
secgroup = cloud.create_security_group(name, description)
|
||||
module.exit_json(
|
||||
changed=True, id=secgroup.id, secgroup=secgroup)
|
||||
changed = True
|
||||
else:
|
||||
if _needs_update(module, secgroup):
|
||||
secgroup = cloud.update_security_group(
|
||||
secgroup['id'], description=description)
|
||||
module.exit_json(
|
||||
changed=True, id=secgroup.id, secgroup=secgroup)
|
||||
else:
|
||||
module.exit_json(changed=False)
|
||||
changed = True
|
||||
module.exit_json(
|
||||
changed=True, id=secgroup.id, secgroup=secgroup)
|
||||
|
||||
if state == 'absent':
|
||||
if not secgroup:
|
||||
|
|
Loading…
Reference in a new issue