Merge "Fix ansible-generate-inventory action" into stable/stein

This commit is contained in:
Zuul 2019-08-05 20:06:47 +00:00 committed by Gerrit Code Review
commit b33182d423
2 changed files with 21 additions and 2 deletions

View File

@ -289,14 +289,15 @@ class TripleoInventory(object):
service_children = [role for role in roles
if ret.get(role) is not None]
if service_children:
ret[service.lower()] = {
svc_host = service.lower()
ret[svc_host] = {
'children': self._hosts(service_children),
'vars': {
'ansible_ssh_user': self.ansible_ssh_user
}
}
if self.ansible_python_interpreter:
ret[role]['vars']['ansible_python_interpreter'] = \
ret[svc_host]['vars']['ansible_python_interpreter'] = \
self.ansible_python_interpreter
if not self.hosts_format_dict:

View File

@ -280,6 +280,24 @@ class TestInventory(base.TestCase):
'container_cli': 'podman',
'ctlplane_vip': 'x.x.x.4',
'redis_vip': 'x.x.x.6'}},
'sa': {'children': ['Controller'],
'vars': {'ansible_ssh_user': 'my-custom-admin',
'ansible_python_interpreter': 'foo'}},
'sb': {'children': ['Controller'],
'vars': {'ansible_ssh_user': 'my-custom-admin',
'ansible_python_interpreter': 'foo'}},
'sd': {'children': ['Compute'],
'vars': {'ansible_ssh_user': 'my-custom-admin',
'ansible_python_interpreter': 'foo'}},
'se': {'children': ['Compute'],
'vars': {'ansible_ssh_user': 'my-custom-admin',
'ansible_python_interpreter': 'foo'}},
'sg': {'children': ['CustomRole'],
'vars': {'ansible_ssh_user': 'my-custom-admin',
'ansible_python_interpreter': 'foo'}},
'sh': {'children': ['CustomRole'],
'vars': {'ansible_ssh_user': 'my-custom-admin',
'ansible_python_interpreter': 'foo'}},
'Undercloud': {
'hosts': ['undercloud'],
'vars': {'ansible_connection': 'ssh',