import logging
from ceph_deploy import exc
from ceph_deploy.util import versions
-from ceph_deploy.hosts import debian, centos, fedora, suse, remotes, rhel, arch
+from ceph_deploy.hosts import debian, centos, fedora, suse, remotes, rhel, arch, alt
from ceph_deploy.connection import get_connection
logger = logging.getLogger()
module.distro = module.normalized_name
module.is_el = module.normalized_name in ['redhat', 'centos', 'fedora', 'scientific', 'oracle', 'virtuozzo']
module.is_rpm = module.normalized_name in ['redhat', 'centos',
- 'fedora', 'scientific', 'suse', 'oracle', 'virtuozzo']
+ 'fedora', 'scientific', 'suse', 'oracle', 'virtuozzo', 'alt']
module.is_deb = module.normalized_name in ['debian', 'ubuntu']
module.is_pkgtarxz = module.normalized_name in ['arch']
module.release = release
'fedora': fedora,
'suse': suse,
'virtuozzo': centos,
- 'arch': arch
+ 'arch': arch,
+ 'alt': alt
}
if distro == 'redhat' and use_rhceph:
return 'virtuozzo'
elif distro.startswith('arch'):
return 'arch'
+ elif distro.startswith(('alt', 'altlinux', 'basealt', 'alt linux')):
+ return 'alt'
return distro
--- /dev/null
+from . import mon # noqa
+from .install import install # noqa
+from .uninstall import uninstall # noqa
+from ceph_deploy.util import pkg_managers
+from ceph_deploy.util.system import is_systemd
+
+# Allow to set some information about this distro
+#
+
+distro = None
+release = None
+codename = None
+
+
+def choose_init(module):
+ """
+ Select a init system
+
+ Returns the name of a init system (systemd, sysvinit ...).
+ """
+
+
+ if is_systemd(module.conn):
+ return 'systemd'
+
+ return 'sysvinit'
+
+
+def get_packager(module):
+ return pkg_managers.AptRpm(module)
--- /dev/null
+from ceph_deploy.hosts.centos.install import repo_install, mirror_install # noqa
+from ceph_deploy.hosts.common import map_components
+from ceph_deploy.util.system import enable_service, start_service
+
+
+NON_SPLIT_PACKAGES = [
+ 'ceph-osd',
+ 'ceph-mds',
+ 'ceph-mon',
+ 'ceph-mgr',
+]
+
+SYSTEMD_UNITS = [
+ 'ceph.target',
+ 'ceph-mds.target',
+ 'ceph-mon.target',
+ 'ceph-mgr.target',
+ 'ceph-osd.target',
+]
+SYSTEMD_UNITS_SKIP_START = [
+ 'ceph-mgr.target',
+ 'ceph-mon.target',
+]
+SYSTEMD_UNITS_SKIP_ENABLE = [
+]
+
+
+def install(distro, version_kind, version, adjust_repos, **kw):
+ packages = map_components(
+ NON_SPLIT_PACKAGES,
+ kw.pop('components', [])
+ )
+
+ if packages:
+ distro.packager.clean()
+ distro.packager.install(packages)
+
+ # Start and enable services
+ for unit in SYSTEMD_UNITS:
+ if unit not in SYSTEMD_UNITS_SKIP_START:
+ start_service(distro.conn, unit)
+ if unit not in SYSTEMD_UNITS_SKIP_ENABLE:
+ enable_service(distro.conn, unit)
--- /dev/null
+from ceph_deploy.hosts.common import mon_add as add # noqa
+from ceph_deploy.hosts.common import mon_create as create # noqa
--- /dev/null
+def uninstall(distro, purge=False):
+ packages = [
+ 'ceph-common',
+ 'ceph-base',
+ 'ceph-radosgw',
+ 'python-module-cephfs',
+ 'python-module-rados',
+ 'python-module-rbd',
+ 'python-module-rgw',
+ ]
+ distro.packager.remove(packages)
def add_repo_gpg_key(self, url):
cmd = ['pacman-key', '-a', url]
self._run(cmd)
+
+
+class AptRpm(PackageManager):
+ """
+ Apt-Rpm package management
+ """
+
+ executable = [
+ 'apt-get',
+ '-y',
+ '-q',
+ '-V',
+ ]
+ name = 'apt'
+
+ def install(self, packages, **kw):
+ if isinstance(packages, str):
+ packages = [packages]
+
+ extra_flags = kw.pop('extra_install_flags', None)
+ cmd = self.executable + ['install']
+
+ if extra_flags:
+ if isinstance(extra_flags, str):
+ extra_flags = [extra_flags]
+ cmd.extend(extra_flags)
+ cmd.extend(packages)
+ return self._run(cmd)
+
+ def remove(self, packages, **kw):
+ if isinstance(packages, str):
+ packages = [packages]
+
+
+ extra_flags = kw.pop('extra_remove_flags', None)
+ cmd = self.executable + [
+ '-y',
+ 'remove'
+ ]
+ if extra_flags:
+ if isinstance(extra_flags, str):
+ extra_flags = [extra_flags]
+ cmd.extend(extra_flags)
+
+ cmd.extend(packages)
+ return self._run(cmd)
+
+ def clean(self):
+ cmd = self.executable + ['update']
+ return self._run(cmd)