mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 08:13:08 +00: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user