]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
create firewall_install for debian
authorAlfredo Deza <alfredo.deza@inktank.com>
Mon, 18 Nov 2013 18:33:26 +0000 (13:33 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Mon, 18 Nov 2013 19:29:57 +0000 (14:29 -0500)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/hosts/debian/__init__.py
ceph_deploy/hosts/debian/install.py

index 3d105e7d0b2e105ee3473cbc89974b2d0760c899..b6f4858e5f4d99ab6607101be51ee6d804b35fb1 100644 (file)
@@ -1,5 +1,5 @@
 import mon
-from install import install
+from install import install, firewall_install
 from uninstall import uninstall
 
 # Allow to set some information about this distro
index f5e3a5ca524d409d88872061a73cefa5892886af..01d234623479198a1c24d66b25f592755ae11f15 100644 (file)
@@ -1,4 +1,5 @@
 from ceph_deploy.lib.remoto import process
+from ceph_deploy.util import pkg_managers
 
 
 def install(distro, version_kind, version, adjust_repos):
@@ -91,3 +92,48 @@ def install(distro, version_kind, version, adjust_repos):
             'gdisk',
             ],
         )
+
+
+def firewall_install(distro, repo_url, gpg_url, adjust_repos):
+    repo_url = repo_url.strip('/')  # Remove trailing slashes
+
+    if adjust_repos:
+        process.run(
+            distro.conn,
+            [
+                'wget',
+                '-q',
+                '-O',
+                'release.asc',
+                gpg_url,
+            ],
+            stop_on_nonzero=False,
+        )
+
+        process.run(
+            distro.conn,
+            [
+                'apt-key',
+                'add',
+                'release.asc'
+            ]
+        )
+
+        distro.conn.remote_module.write_sources_list(repo_url, distro.codename)
+
+    # Before any install, make sure we have `wget`
+    pkg_managers.apt_update(distro.conn)
+    packages = (
+        'ceph',
+        'ceph-mds',
+        'ceph-common',
+        'ceph-fs-common',
+        # ceph only recommends gdisk, make sure we actually have
+        # it; only really needed for osds, but minimal collateral
+        'gdisk',
+    )
+
+    for pkg in packages:
+        pkg_managers.apt(distro.conn, pkg)
+
+    pkg_managers.apt(distro.conn, 'ceph')