From 89f95471f8b37de49b79abb1e49347b431b8cb6d Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 17 Jun 2015 04:20:42 -0400 Subject: [PATCH] Return secgroup, not just id --- lib/ansible/modules/cloud/openstack/os_security_group.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/openstack/os_security_group.py b/lib/ansible/modules/cloud/openstack/os_security_group.py index 4aaff2470d..4f929e62f4 100644 --- a/lib/ansible/modules/cloud/openstack/os_security_group.py +++ b/lib/ansible/modules/cloud/openstack/os_security_group.py @@ -118,12 +118,14 @@ def main(): if state == 'present': if not secgroup: secgroup = cloud.create_security_group(name, description) - module.exit_json(changed=True, id=secgroup['id']) + module.exit_json( + changed=True, id=secgroup.id, secgroup=secgroup) else: if _needs_update(module, secgroup): secgroup = cloud.update_security_group( secgroup['id'], description=description) - module.exit_json(changed=True, id=secgroup['id']) + module.exit_json( + changed=True, id=secgroup.id, secgroup=secgroup) else: module.exit_json(changed=False)