From: Alfredo Deza Date: Fri, 3 Oct 2014 16:45:07 +0000 (-0400) Subject: ensure priorities for custom repos as well X-Git-Tag: v1.5.17~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F246%2Fhead;p=ceph-deploy.git ensure priorities for custom repos as well Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/centos/install.py b/ceph_deploy/hosts/centos/install.py index af0b395..4f11c35 100644 --- a/ceph_deploy/hosts/centos/install.py +++ b/ceph_deploy/hosts/centos/install.py @@ -143,18 +143,24 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True) ) distro.conn.remote_module.write_yum_repo(ceph_repo_content) + # set the right priority + install_yum_priorities(distro) + distro.conn.remote_module.set_repo_priority(['Ceph', 'Ceph-noarch', 'ceph-source']) + distro.conn.logger.warning('alter.d ceph.repo priorities to contain: priority=1') + if extra_installs: pkg_managers.yum(distro.conn, 'ceph') def repo_install(distro, reponame, baseurl, gpgkey, **kw): + logger = distro.conn.logger # Get some defaults - name = kw.get('name', '%s repo' % reponame) - enabled = kw.get('enabled', 1) - gpgcheck = kw.get('gpgcheck', 1) + name = kw.pop('name', '%s repo' % reponame) + enabled = kw.pop('enabled', 1) + gpgcheck = kw.pop('gpgcheck', 1) install_ceph = kw.pop('install_ceph', False) - proxy = kw.get('proxy') + proxy = kw.pop('proxy', '') # will get ignored if empty _type = 'repo-md' baseurl = baseurl.strip('/') # Remove trailing slashes @@ -179,6 +185,7 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw): _type=_type, gpgkey=gpgkey, proxy=proxy, + **kw ) distro.conn.remote_module.write_yum_repo( @@ -186,6 +193,21 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw): "%s.repo" % reponame ) + repo_path = '/etc/yum.repos.d/{reponame}.repo'.format(reponame=reponame) + + # set the right priority + if kw.get('priority'): + install_yum_priorities(distro) + logger.warning( + 'ensuring that {repo_path} contains a high priority'.format( + repo_path=repo_path) + ) + + distro.conn.remote_module.set_repo_priority([reponame], repo_path) + logger.warning('altered {reponame}.repo priorities to contain: priority=1'.format( + reponame=reponame) + ) + # Some custom repos do not need to install ceph if install_ceph: pkg_managers.yum(distro.conn, 'ceph')