Add --flush-cache to launch.py ansible

I managed to leave off the "--image" flag for a Xenial host, so the
script created a Bionic host by default.  I let that play out, deleted
the host and tried again with the correct image, but what ended up
happening was the fact cache thought this new host was Bionic, and
several ansible roles therefore ran thinking this too, and we ended up
with a bad Xenial/Bionic mashup.

Clear the cache on node launch to avoid this sort of thing again.

I have launched a node with this new option, and it worked.

Change-Id: Ie37f562402bed3846f27fbdd4441b5f4dcec7eb2
This commit is contained in:
Ian Wienand 2019-02-27 10:56:32 +11:00
parent ffd56ffc75
commit 86d0d78255
1 changed files with 1 additions and 0 deletions

View File

@ -178,6 +178,7 @@ def bootstrap_server(server, key, name, volume_device, keep,
])
ansible_cmd = [
'ansible-playbook',
'--flush-cache',
'-i', inventory_list, '-l', name,
'--private-key={key}'.format(key=jobdir.key),
"--ssh-common-args='-o StrictHostKeyChecking=no'",