Use undercloud-connection to local for running validations with the CLI

This patch adds the **undercloud_connection** (set to 'ssh' by default)
parameter to the get_tripleo_ansible_inventory() function which allow
the CLI to create a static inventory file with local connection for the
undercloud.

Change-Id: I50d486afe2a11e830c72145154dc2b0764aece07
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
(cherry picked from commit 5075a76366)
This commit is contained in:
Gael Chamoulaud 2019-09-03 14:43:24 +02:00
parent 85188ebf67
commit 7a68851c5e
2 changed files with 5 additions and 2 deletions

View File

@ -1200,6 +1200,7 @@ def load_environment_directories(directories):
def get_tripleo_ansible_inventory(inventory_file=None,
ssh_user='tripleo-admin',
stack='overcloud',
undercloud_connection='ssh',
return_inventory_file_path=False):
if not inventory_file:
inventory_file = '%s/%s' % (os.path.expanduser('~'),
@ -1209,7 +1210,7 @@ def get_tripleo_ansible_inventory(inventory_file=None,
'/usr/bin/tripleo-ansible-inventory',
'--stack', stack,
'--ansible_ssh_user', ssh_user,
'--undercloud-connection', 'ssh',
'--undercloud-connection', undercloud_connection,
'--undercloud-key-file',
'/var/lib/mistral/.ssh/tripleo-admin-rsa',
'--static-yaml-inventory', inventory_file)

View File

@ -367,7 +367,9 @@ class TripleOValidatorRun(command.Command):
"/usr/bin/python{}".format(sys.version_info[0])
static_inventory = oooutils.get_tripleo_ansible_inventory(
ssh_user='heat-admin', stack=parsed_args.plan,
ssh_user='heat-admin',
stack=parsed_args.plan,
undercloud_connection='local',
return_inventory_file_path=True)
failed_val = False