From: Alfredo Deza Date: Fri, 26 Sep 2014 14:18:13 +0000 (-0400) Subject: add a remote helper to pin repos X-Git-Tag: v1.5.16~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=be563616e5cd4f049afdb2cc8fdf5bd362a851c6;p=ceph-deploy.git add a remote helper to pin repos Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index 26c4100..c000c2f 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -57,6 +57,13 @@ def write_yum_repo(content, filename='ceph.repo'): write_file(repo_path, content) +def set_apt_priority(fqdn, path='/etc/apt/preferences.d/ceph.pref'): + template = "Package: *\nPin: origin {fqdn}\nPin-Priority: 999\n" + content = template.format(fqdn=fqdn) + with open(path, 'wb') as fout: + fout.write(content) + + def set_repo_priority(sections, path='/etc/yum.repos.d/ceph.repo', priority='1'): Config = ConfigParser.ConfigParser() Config.read(path)