Browse Source

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)
tags/11.5.1
Gael Chamoulaud 2 weeks ago
parent
commit
7a68851c5e
2 changed files with 5 additions and 2 deletions
  1. 2
    1
      tripleoclient/utils.py
  2. 3
    1
      tripleoclient/v1/tripleo_validator.py

+ 2
- 1
tripleoclient/utils.py View File

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

+ 3
- 1
tripleoclient/v1/tripleo_validator.py View File

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

Loading…
Cancel
Save