]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-12543] centos: only install requested packages
authorTravis Rhoden <trhoden@redhat.com>
Fri, 31 Jul 2015 19:12:30 +0000 (12:12 -0700)
committerTravis Rhoden <trhoden@redhat.com>
Mon, 3 Aug 2015 20:16:33 +0000 (13:16 -0700)
Refs: #12543

Signed-off-by: Travis Rhoden <trhoden@redhat.com>
ceph_deploy/hosts/centos/install.py

index fbec63f4f422f1dcf716f2a42bf2ac2b36539dd2..3d0d4731cd0cb777b587b966caa86bc256e1a0c7 100644 (file)
@@ -1,9 +1,13 @@
 from ceph_deploy.util import pkg_managers, templates
 from ceph_deploy.lib import remoto
 from ceph_deploy.hosts.util import install_yum_priorities
+from ceph_deploy.hosts.common import map_components
 from ceph_deploy.util.paths import gpg
 
 
+NON_SPLIT_PACKAGES = ['ceph-osd', 'ceph-mon', 'ceph-mds']
+
+
 def rpm_dist(distro):
     if distro.normalized_name in ['redhat', 'centos', 'scientific'] and distro.normalized_release.int_major >= 6:
         return 'el' + distro.normalized_release.major
@@ -36,8 +40,10 @@ def repository_url_part(distro):
 
 
 def install(distro, version_kind, version, adjust_repos, **kw):
-    # note: when split packages for ceph land for CentOS, `kw['components']`
-    # will have those. Unused for now.
+    packages = map_components(
+        NON_SPLIT_PACKAGES,
+        kw.pop('components', [])
+    )
     logger = distro.conn.logger
     release = distro.release
     machine = distro.machine_type
@@ -105,16 +111,17 @@ def install(distro, version_kind, version, adjust_repos, **kw):
         distro.conn.remote_module.set_repo_priority(['Ceph', 'Ceph-noarch', 'ceph-source'])
         logger.warning('altered ceph.repo priorities to contain: priority=1')
 
-    remoto.process.run(
-        distro.conn,
-        [
+    if len(packages):
+        cmd = [
             'yum',
             '-y',
             'install',
-            'ceph',
-            'ceph-radosgw',
-        ],
-    )
+        ]
+        cmd.extend(packages)
+        remoto.process.run(
+            distro.conn,
+            cmd,
+        )
 
 
 def install_epel(distro):
@@ -128,8 +135,10 @@ def install_epel(distro):
 
 
 def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True, **kw):
-    # note: when split packages for ceph land for CentOS, `kw['components']`
-    # will have those. Unused for now.
+    packages = map_components(
+        NON_SPLIT_PACKAGES,
+        kw.pop('components', [])
+    )
     repo_url = repo_url.strip('/')  # Remove trailing slashes
     gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present
 
@@ -158,15 +167,14 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True,
 
 
     if extra_installs:
-        pkg_managers.yum(distro.conn, 'ceph')
+        pkg_managers.yum(distro.conn, packages)
 
 
 def repo_install(distro, reponame, 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 CentOS, `packages`
-    # can be used. Unused for now.
-    packages = kw.pop('components', [])  # noqa
+    packages = map_components(
+        NON_SPLIT_PACKAGES,
+        kw.pop('components', [])
+    )
     logger = distro.conn.logger
     # Get some defaults
     name = kw.pop('name', '%s repo' % reponame)
@@ -223,4 +231,4 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw):
 
     # Some custom repos do not need to install ceph
     if install_ceph:
-        pkg_managers.yum(distro.conn, 'ceph')
+        pkg_managers.yum(distro.conn, packages)