From: Travis Rhoden Date: Fri, 31 Jul 2015 18:56:39 +0000 (-0700) Subject: [RM-12543] debian: only install requested packages X-Git-Tag: v1.5.27~7^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=39dc7741766563069bb42a79015e3843331a91d2;p=ceph-deploy.git [RM-12543] debian: only install requested packages Refs: #12543 Signed-off-by: Travis Rhoden --- diff --git a/ceph_deploy/hosts/debian/install.py b/ceph_deploy/hosts/debian/install.py index 3d02824..6944758 100644 --- a/ceph_deploy/hosts/debian/install.py +++ b/ceph_deploy/hosts/debian/install.py @@ -3,11 +3,17 @@ from urlparse import urlparse from ceph_deploy.lib import remoto from ceph_deploy.util import pkg_managers from ceph_deploy.util.paths import gpg +from ceph_deploy.hosts.common import map_components + + +NON_SPLIT_COMPONENTS = ['ceph-osd', 'ceph-mon'] def install(distro, version_kind, version, adjust_repos, **kw): - # note: when split packages for ceph land for Debian/Ubuntu, - # `kw['components']` will have those. Unused for now. + packages = map_components( + NON_SPLIT_COMPONENTS, + kw.pop('components', []) + ) codename = distro.codename machine = distro.machine_type @@ -81,9 +87,8 @@ def install(distro, version_kind, version, adjust_repos, **kw): ) # TODO this does not downgrade -- should it? - remoto.process.run( - distro.conn, - [ + if len(packages): + cmd = [ 'env', 'DEBIAN_FRONTEND=noninteractive', 'DEBIAN_PRIORITY=critical', @@ -94,18 +99,19 @@ def install(distro, version_kind, version, adjust_repos, **kw): '--assume-yes', 'install', '--', - 'ceph', - 'ceph-mds', - 'ceph-common', - 'ceph-fs-common', - 'radosgw', - ], + ] + cmd.extend(packages) + remoto.process.run( + distro.conn, + cmd ) def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw): - # note: when split packages for ceph land for Debian/Ubuntu, - # `kw['components']` will have those. Unused for now. + packages = map_components( + NON_SPLIT_COMPONENTS, + kw.pop('components', []) + ) repo_url = repo_url.strip('/') # Remove trailing slashes gpg_path = gpg_url.split('file://')[-1] @@ -139,23 +145,14 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw): distro.conn.remote_module.write_sources_list(repo_url, distro.codename) pkg_managers.apt_update(distro.conn) - packages = ( - 'ceph', - 'ceph-mds', - 'ceph-common', - 'ceph-fs-common', - ) - pkg_managers.apt(distro.conn, packages) - pkg_managers.apt(distro.conn, 'ceph') def repo_install(distro, repo_name, baseurl, gpgkey, **kw): - # do we have specific components to install? - # removed them from `kw` so that we don't mess with other defaults - # note: when split packages for ceph land for Debian/Ubuntu, `packages` - # can be used. Unused for now. - packages = kw.pop('components', []) + packages = map_components( + NON_SPLIT_COMPONENTS, + kw.pop('components', []) + ) # Get some defaults safe_filename = '%s.list' % repo_name.replace(' ', '-') install_ceph = kw.pop('install_ceph', False) @@ -196,13 +193,4 @@ def repo_install(distro, repo_name, baseurl, gpgkey, **kw): pkg_managers.apt_update(distro.conn) if install_ceph: - # Before any install, make sure we have `wget` - packages = ( - 'ceph', - 'ceph-mds', - 'ceph-common', - 'ceph-fs-common', - ) - pkg_managers.apt(distro.conn, packages) - pkg_managers.apt(distro.conn, 'ceph')