]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
ceph_ansible: Get smithi lvm install working wip-get-ceph-ansible-working-on-smithi
authorBrad Hubbard <bhubbard@redhat.com>
Tue, 4 Feb 2020 01:17:05 +0000 (11:17 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Wed, 5 Feb 2020 04:03:22 +0000 (14:03 +1000)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
teuthology/report.py
teuthology/task/ceph_ansible.py

index 7b23e7d8e5afc6e548539e274af3e60841d2630d..67821b6350975ef188b9ee4c97758d777a6d5969 100644 (file)
@@ -288,6 +288,7 @@ class ResultsReporter(object):
         if dead and get_status(job_info) is None:
             set_status(job_info, 'dead')
         job_json = json.dumps(job_info)
+        self.log.debug("job_json: %s", job_json)
         headers = {'content-type': 'application/json'}
         response = self.session.post(run_uri, data=job_json, headers=headers)
 
index d5fe471a82a958e42f8ab6b96432f02451320362..0db80e0e72ea661402397f7567ea211c3444a606 100644 (file)
@@ -7,7 +7,7 @@ import yaml
 from teuthology.task import Task
 from tempfile import NamedTemporaryFile
 from teuthology.config import config as teuth_config
-from teuthology.misc import get_scratch_devices
+from teuthology.misc import get_scratch_devices, get_file
 from teuthology import contextutil
 from teuthology.orchestra import run
 from teuthology import misc
@@ -56,6 +56,8 @@ class CephAnsible(Task):
 
     def __init__(self, ctx, config):
         super(CephAnsible, self).__init__(ctx, config)
+        print(ctx)
+        print(config)
         config = self.config or dict()
         self.playbook = None
         if 'playbook' in config:
@@ -302,13 +304,36 @@ class CephAnsible(Task):
                     break
 
     def get_host_vars(self, remote):
+        print("get_host_vars")
         extra_vars = self.config.get('vars', dict())
+        print(extra_vars)
         host_vars = dict()
         if not extra_vars.get('osd_auto_discovery', False):
             roles = self.ctx.cluster.remotes[remote]
             dev_needed = len([role for role in roles
                               if role.startswith('osd')])
-            host_vars['devices'] = get_scratch_devices(remote)[0:dev_needed]
+            if self.ctx.machine_type in teuth_config['ceph_ansible']['has_lvm_scratch_disks']:
+                devices = get_file(remote, "/scratch_devs").split()
+                print("[[[[]]]]")
+                print(devices)
+                vols = []
+
+                print("[[[[]]]]")
+                print(self.config.get('vars', dict()))
+
+                for dev in devices:
+                   if 'vg_nvme' in dev:
+                       splitpath = dev.split('/')
+                       vol = dict()
+                       vol['data_vg'] = splitpath[2]
+                       vol['data'] = splitpath[3]
+                       vols.append(dict(vol))
+                extra_vars['lvm_volumes'] = vols
+                self.config.update({'vars': extra_vars})
+                print("[[[[]]]]")
+                print(self.config.get('vars', dict()))
+            else:
+                host_vars['devices'] = get_scratch_devices(remote)[0:dev_needed]
         if 'monitor_interface' not in extra_vars:
             host_vars['monitor_interface'] = remote.interface
         if 'radosgw_interface' not in extra_vars: