Merge "launch.py: Fix inventory list"

This commit is contained in:
Zuul 2019-05-20 22:00:09 +00:00 committed by Gerrit Code Review
commit a4566bab0c

View File

@ -170,20 +170,19 @@ def bootstrap_server(server, key, name, volume_device, keep,
t.daemon = True t.daemon = True
t.start() t.start()
inventory_list = ','.join([ inventory_list = (
jobdir.inventory_root, jobdir.inventory_root,
'/opt/system-config/inventory/openstack.yaml', '/opt/system-config/inventory/openstack.yaml',
'/opt/system-config/inventory/groups.yaml', '/opt/system-config/inventory/groups.yaml',
'/opt/system-config/inventory/emergency.yaml', '/opt/system-config/inventory/emergency.yaml',
]) )
ansible_cmd = [ inventory_cmds = [v for e in inventory_list for v in ('-i', e)]
'ansible-playbook', ansible_cmd = ['ansible-playbook', '--flush-cache' ] + \
'--flush-cache', inventory_cmds + \
'-i', inventory_list, '-l', name, ['-l', name,
'--private-key={key}'.format(key=jobdir.key), '--private-key={key}'.format(key=jobdir.key),
"--ssh-common-args='-o StrictHostKeyChecking=no'", "--ssh-common-args='-o StrictHostKeyChecking=no'",
'-e', 'target={name}'.format(name=name), '-e', 'target={name}'.format(name=name)]
]
# Run the base playbook limited to just this server we just created # Run the base playbook limited to just this server we just created
for playbook in [ for playbook in [