mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-10 02:41:30 +00:00
Fix openstack inventory for multiple servers
Fix openstack inventory for when we have multiple servers with the same name but different IDs. Instead of giving every server with the same name the details for the first server returned with that name add the individual servers as they are returned. This was a logic bug where in a loop over a list of servers we always added the first server in that list despite having more than one server.
This commit is contained in:
@@ -149,7 +149,7 @@ def get_host_groups_from_cloud(inventory):
|
||||
else:
|
||||
for server in servers:
|
||||
append_hostvars(
|
||||
hostvars, groups, server['id'], servers[0],
|
||||
hostvars, groups, server['id'], server,
|
||||
namegroup=True)
|
||||
groups['_meta'] = {'hostvars': hostvars}
|
||||
return groups
|
||||
|
||||
Reference in New Issue
Block a user