From: Dan Mick Date: Thu, 23 Jul 2015 00:28:01 +0000 (-0700) Subject: calamari_setup: disable epel again after ceph-deploy X-Git-Tag: v10.2.6~165^2^2~432^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2006b77340ad7bf07070fd94bd3f1af06189a1d5;p=ceph.git calamari_setup: disable epel again after ceph-deploy ceph-deploy enables EPEL on Centos; this caused problems for Calamari. Undo it after ceph-deploy has installed Ceph. Signed-off-by: Dan Mick --- diff --git a/tasks/calamari_setup.py b/tasks/calamari_setup.py index 431e3699393d..1e2da3699865 100644 --- a/tasks/calamari_setup.py +++ b/tasks/calamari_setup.py @@ -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.