module.conn = conn
module.machine_type = machine_type
module.init = module.choose_init()
- if module.normalized_name in ['fedora', 'centos']:
+ if module.normalized_name in ['fedora', 'centos', 'redhat']:
module.packager = module.get_packager(module)
return module
import pkg # noqa
from install import install, mirror_install, repo_install # noqa
from uninstall import uninstall # noqa
+from ceph_deploy.util import pkg_managers
# Allow to set some information about this distro
#
Returns the name of a init system (upstart, sysvinit ...).
"""
return 'sysvinit'
+
+
+def get_packager(module):
+ return pkg_managers.Yum(module)
-from ceph_deploy.util import pkg_managers, templates
+from ceph_deploy.util import templates
from ceph_deploy.lib import remoto
def install(distro, version_kind, version, adjust_repos, **kw):
packages = kw.get('components', [])
- pkg_managers.yum_clean(distro.conn)
- pkg_managers.yum(distro.conn, packages)
+ distro.packager.clean()
+ distro.packager.install(packages)
def mirror_install(distro, repo_url,
repo_url = repo_url.strip('/') # Remove trailing slashes
gpg_url_path = gpg_url.split('file://')[-1] # Remove file if present
- pkg_managers.yum_clean(distro.conn)
+ distro.packager.clean()
if adjust_repos:
remoto.process.run(
distro.conn.remote_module.write_yum_repo(ceph_repo_content)
- if extra_installs:
- pkg_managers.yum(distro.conn, packages)
+ if extra_installs and packages:
+ distro.packager.install(packages)
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
_type = 'repo-md'
baseurl = baseurl.strip('/') # Remove trailing slashes
- pkg_managers.yum_clean(distro.conn)
+ distro.packager.clean()
if gpgkey:
remoto.process.run(
)
# Some custom repos do not need to install ceph
- if install_ceph:
- pkg_managers.yum(distro.conn, packages)
+ if install_ceph and packages:
+ distro.packager.install(packages)
-from ceph_deploy.util import pkg_managers
-
-
def uninstall(distro, purge=False):
packages = [
'ceph',
'ceph-radosgw'
]
- pkg_managers.yum_remove(
- distro.conn,
- packages,
- )
-
- pkg_managers.yum_clean(distro.conn)
+ distro.packager.remove(packages)
+ distro.packager.clean()