From 2006b77340ad7bf07070fd94bd3f1af06189a1d5 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 22 Jul 2015 17:28:01 -0700 Subject: [PATCH] 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 --- tasks/calamari_setup.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tasks/calamari_setup.py b/tasks/calamari_setup.py index 431e3699393..1e2da369986 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.