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>
This commit is contained in:
Gael Chamoulaud 2019-09-03 14:43:24 +02:00
parent 7c00851ac2
commit 5075a76366
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -367,7 +367,9 @@ class TripleOValidatorRun(command.Command):
"/usr/bin/python{}".format(sys.version_info[0]) "/usr/bin/python{}".format(sys.version_info[0])
static_inventory = oooutils.get_tripleo_ansible_inventory( 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) return_inventory_file_path=True)
failed_val = False failed_val = False