From: Alfredo Deza Date: Wed, 12 Mar 2014 19:36:53 +0000 (-0400) Subject: add repo install to debian X-Git-Tag: v1.4.0~5^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0cdac204e2986ad06edebd2845a7dcb712c965eb;p=ceph-deploy.git add repo install to debian Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/debian/__init__.py b/ceph_deploy/hosts/debian/__init__.py index 5a4e347..9951486 100644 --- a/ceph_deploy/hosts/debian/__init__.py +++ b/ceph_deploy/hosts/debian/__init__.py @@ -1,6 +1,6 @@ import mon import pkg -from install import install, mirror_install +from install import install, mirror_install, repo_install from uninstall import uninstall # Allow to set some information about this distro diff --git a/ceph_deploy/hosts/debian/install.py b/ceph_deploy/hosts/debian/install.py index de9f127..91bb91f 100644 --- a/ceph_deploy/hosts/debian/install.py +++ b/ceph_deploy/hosts/debian/install.py @@ -131,7 +131,54 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos): 'gdisk', ) - for pkg in packages: - pkg_managers.apt(distro.conn, pkg) - + pkg_managers.apt(distro.conn, packages) pkg_managers.apt(distro.conn, 'ceph') + + +def repo_install(distro, repo_name, baseurl, gpgkey, **kw): + # Get some defaults + safe_filename = '%s.list' % repo_name.replace(' ', '-') + install_ceph = kw.pop('install_ceph', False) + baseurl = baseurl.strip('/') # Remove trailing slashes + + process.run( + distro.conn, + [ + 'wget', + '-O', + 'release.asc', + gpgkey, + ], + stop_on_nonzero=False, + ) + + process.run( + distro.conn, + [ + 'apt-key', + 'add', + 'release.asc' + ] + ) + + distro.conn.remote_module.write_sources_list( + baseurl, + distro.codename, + safe_filename + ) + + if install_ceph: + # Before any install, make sure we have `wget` + pkg_managers.apt_update(distro.conn) + packages = ( + 'ceph', + 'ceph-mds', + 'ceph-common', + 'ceph-fs-common', + # ceph only recommends gdisk, make sure we actually have + # it; only really needed for osds, but minimal collateral + 'gdisk', + ) + + pkg_managers.apt(distro.conn, packages) + pkg_managers.apt(distro.conn, 'ceph')