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
)
# TODO this does not downgrade -- should it?
- remoto.process.run(
- distro.conn,
- [
+ if len(packages):
+ cmd = [
'env',
'DEBIAN_FRONTEND=noninteractive',
'DEBIAN_PRIORITY=critical',
'--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]
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)
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')