launch-node.py : make sure new inventory comes last

If you happen to be booting a replacement host, you don't want ansible
to pick up the current host from the current inventory.  Put the new
server's inventory last in the list so it overrides and before it.

Change-Id: I3f1edfb95924dae0256f969bc740f1141e291c25
This commit is contained in:
Ian Wienand 2020-02-07 14:09:00 +11:00
parent 7227bcf879
commit 8980905319

View File

@ -177,10 +177,10 @@ def bootstrap_server(server, key, name, volume_device, keep,
t.start()
inventory_list = (
jobdir.inventory_root,
'/opt/system-config/inventory/openstack.yaml',
'/opt/system-config/inventory/groups.yaml',
'/etc/ansible/hosts/emergency.yaml',
jobdir.inventory_root,
)
inventory_cmds = [v for e in inventory_list for v in ('-i', e)]
ansible_cmd = ['ansible-playbook', '--flush-cache' ] + \