]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
create the install module for fedora
authorAlfredo Deza <alfredo@deza.pe>
Thu, 25 Jul 2013 15:11:56 +0000 (11:11 -0400)
committerAlfredo Deza <alfredo@deza.pe>
Thu, 25 Jul 2013 15:11:56 +0000 (11:11 -0400)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
ceph_deploy/hosts/fedora/install.py [new file with mode: 0644]

diff --git a/ceph_deploy/hosts/fedora/install.py b/ceph_deploy/hosts/fedora/install.py
new file mode 100644 (file)
index 0000000..099454c
--- /dev/null
@@ -0,0 +1,55 @@
+
+
+def install(release, codename, version_kind, version):
+    import platform
+    import subprocess
+
+    if version_kind in ['stable', 'testing']:
+        key = 'release'
+    else:
+        key = 'autobuild'
+
+    subprocess.check_call(
+        args='su -c \'rpm --import "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"\''.format(key=key),
+        shell=True,
+        )
+
+    if version_kind == 'stable':
+        url = 'http://ceph.com/rpm-{version}/fc{release}/'.format(
+            version=version,
+            release=release,
+            )
+    elif version_kind == 'testing':
+        url = 'http://ceph.com/rpm-testing/fc{release}'.format(
+            release=release,
+            )
+    elif version_kind == 'dev':
+        url = 'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'.format(
+            release=release.split(".", 1)[0],
+            machine=platform.machine(),
+            version=version,
+            )
+
+    subprocess.check_call(
+        args=[
+            'rpm',
+            '-Uvh',
+            '--replacepkgs',
+            '--force',
+            '--quiet',
+            '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
+                url=url,
+                release=release,
+                ),
+            ]
+        )
+
+    subprocess.check_call(
+        args=[
+            'yum',
+            '-y',
+            '-q',
+            'install',
+            'ceph',
+            ],
+        )