diff options
author | Maxim Babushkin <babushkin.max@gmail.com> | 2019-05-09 19:38:29 +0300 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2019-05-09 12:38:28 -0400 |
commit | 45ee165fcd0f4bf53cee130aa133e4046aeb8df8 (patch) | |
tree | d3a816a330e3b1b69968802b86b9e2cf72b5a1f3 | |
parent | 46c44a4359dbd65ba69c0827c0cc9cf1cec5bc98 (diff) | |
download | ansible-45ee165fcd0f4bf53cee130aa133e4046aeb8df8.tar.gz |
os_nova_host_aggregate - Fix aggregate delete with hosts (#53166)
Aggregate delete task will fail in case it has hosts within the aggregate.
As by the OpenStack, the hosts should be removed from the aggregate
prior aggregate delete.
Add remove host in case provided.
-rw-r--r-- | lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py | 3 |
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) |