]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
calamari_setup: disable epel again after ceph-deploy
authorDan Mick <dan.mick@redhat.com>
Thu, 23 Jul 2015 00:28:01 +0000 (17:28 -0700)
committerDan Mick <dan.mick@redhat.com>
Thu, 23 Jul 2015 00:28:55 +0000 (17:28 -0700)
ceph-deploy enables EPEL on Centos; this caused problems for
Calamari.  Undo it after ceph-deploy has installed Ceph.

Signed-off-by: Dan Mick <dan.mick@redhat.com>
tasks/calamari_setup.py

index 431e3699393d3b83f8e180c4966194b1a974b99c..1e2da3699865e338c5edd91a53c1c85d7220dd4c 100644 (file)
@@ -65,6 +65,8 @@ def task(ctx, config):
         lambda: adjust_yum_repos(ctx, cal_svr, config['no_epel']),
         lambda: calamari_install(config, cal_svr),
         lambda: ceph_install(ctx, cal_svr),
+        # do it again because ceph-deploy installed epel for centos
+        lambda: remove_epel(ctx, config['no_epel']),
         lambda: calamari_connect(ctx, cal_svr),
         lambda: browser(config['start_browser'], cal_svr.hostname),
     ):
@@ -153,6 +155,24 @@ def fix_yum_repos(remote, distro):
     return True
 
 
+@contextlib.contextmanager
+def remove_epel(ctx, no_epel):
+    """
+    just remove epel.  No undo; assumed that it's used after
+    adjust_yum_repos, and relies on its state-save/restore.
+    """
+    if no_epel:
+        for remote in ctx.cluster.remotes:
+            if remote.os.name.startswith('centos'):
+                remote.run(args= [
+                    'sudo', 'rm', '-f', run.Raw('/etc/yum.repos.d/epel*')
+                ])
+    try:
+        yield
+    finally:
+        pass
+
+
 def get_iceball_with_http(url, destdir):
     '''
     Copy iceball with http to destdir.  Try both .tar.gz and .iso.