mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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.
This commit is contained in:
parent
46c44a4359
commit
45ee165fcd
1 changed files with 3 additions and 0 deletions
|
@ -167,6 +167,9 @@ def main():
|
||||||
if aggregate is None:
|
if aggregate is None:
|
||||||
changed = False
|
changed = False
|
||||||
else:
|
else:
|
||||||
|
if hosts:
|
||||||
|
for h in hosts:
|
||||||
|
cloud.remove_host_from_aggregate(aggregate.id, h)
|
||||||
cloud.delete_aggregate(aggregate.id)
|
cloud.delete_aggregate(aggregate.id)
|
||||||
changed = True
|
changed = True
|
||||||
module.exit_json(changed=changed)
|
module.exit_json(changed=changed)
|
||||||
|
|
Loading…
Reference in a new issue