summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py')
-rw-r--r--lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py b/lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py
index 931bc8cdb3..94bd628988 100644
--- a/lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py
+++ b/lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py
@@ -167,6 +167,9 @@ def main():
if aggregate is None:
changed = False
else:
+ if hosts:
+ for h in hosts:
+ cloud.remove_host_from_aggregate(aggregate.id, h)
cloud.delete_aggregate(aggregate.id)
changed = True
module.exit_json(changed=changed)