1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
Clark Boylan 2016-03-15 16:42:06 -07:00
parent 6b1b4e03b0
commit 7d5650219d

View file

@ -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