Pass undercloud's private key to inventory used in package_update.

As the Ansible playbook is being executed from the mistral_executor
container, we need to establish a conection to the Undercloud via ssh
not local as it was being done up to now. In order to be able to ssh
into the host we need to provide with the tripleo-ansible's user ssh
key.

Depends-On: https://review.opendev.org/#/c/677777/

Closes-Bug: #1832932
Change-Id: I20948d49b3023dc76acff8779bbe182886e55838

(cherry picked from commit 28a3d02061)
This commit is contained in:
Jose Luis Franco Arza 2019-08-14 16:32:09 +02:00 committed by Sergii Golovatiuk
parent 17079abbbb
commit 9b9b5aaadc
1 changed files with 2 additions and 0 deletions

View File

@ -1210,6 +1210,8 @@ def get_tripleo_ansible_inventory(inventory_file=None,
'--stack', stack,
'--ansible_ssh_user', ssh_user,
'--undercloud-connection', 'ssh',
'--undercloud-key-file',
'/var/lib/mistral/.ssh/tripleo-admin-rsa',
'--static-yaml-inventory', inventory_file)
except processutils.ProcessExecutionError as e:
message = _("Failed to generate inventory: %s") % str(e)