From c1e081fcf6ea85940654e3d86e9a9d80cd1b401a Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Thu, 22 Oct 2015 13:38:32 -0400 Subject: [PATCH] make os_network correctly report changed status The `os_network` module was incorrectly returning changed=False whether or not the network was created. This commit makes the changed return value useful. --- lib/ansible/modules/cloud/openstack/os_network.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/openstack/os_network.py b/lib/ansible/modules/cloud/openstack/os_network.py index bc41d3870f4..82863ebd6b5 100644 --- a/lib/ansible/modules/cloud/openstack/os_network.py +++ b/lib/ansible/modules/cloud/openstack/os_network.py @@ -146,7 +146,10 @@ def main(): if state == 'present': if not net: net = cloud.create_network(name, shared, admin_state_up, external) - module.exit_json(changed=False, network=net, id=net['id']) + changed = True + else: + changed = False + module.exit_json(changed=changed, network=net, id=net['id']) elif state == 'absent': if not net: