]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add ansible task to install repo if config provides it 610/head
authorVasu Kulkarni <vasu@redhat.com>
Thu, 3 Sep 2015 16:23:50 +0000 (12:23 -0400)
committerVasu Kulkarni <vasu@redhat.com>
Fri, 4 Sep 2015 22:49:41 +0000 (18:49 -0400)
If playbook is specificed as shown in doc string usage, It will run ansible task and install
the repos so that rpm's can be installed from the provided repo

Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
teuthology/task/install.py

index 2a0affe53eec54a0625471ce1775c5b63d0fb4a8..3e949a5c7ddf32051e22b307707d639f382d7d62 100644 (file)
@@ -12,6 +12,7 @@ from teuthology import misc as teuthology
 from teuthology import contextutil, packaging
 from teuthology.parallel import parallel
 from ..orchestra import run
+from . import ansible
 
 log = logging.getLogger(__name__)
 
@@ -1143,7 +1144,12 @@ def task(ctx, config):
         branch: foo
         extra_packages: ['samba']
     - install:
-        rhbuild: 1.2.3
+        rhbuild: 1.3.0 
+        playbook: downstream_setup.yml
+        vars:
+           yum_repos:
+             - url: "http://location.repo"
+               name: "ceph_repo"
 
     Overrides are project specific:
 
@@ -1179,13 +1185,17 @@ def task(ctx, config):
     log.info("Using flavor: %s", flavor)
 
     ctx.summary['flavor'] = flavor
+    nested_tasks = [lambda: rh_install(ctx=ctx, config=config),
+                    lambda: ship_utilities(ctx=ctx, config=None)]
 
     if config.get('rhbuild'):
-        with contextutil.nested(
-            lambda: rh_install(ctx=ctx, config=config),
-            lambda: ship_utilities(ctx=ctx, config=None)
-        ):
-            yield
+        if config.get('playbook'):
+            ansible_config=dict(config)
+            # remove key not required by ansible task
+            del ansible_config['rhbuild']
+            nested_tasks.insert(0, lambda: ansible.CephLab(ctx,config=ansible_config))
+        with contextutil.nested(*nested_tasks):
+                yield
     else:
         with contextutil.nested(
             lambda: install(ctx=ctx, config=dict(