]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-14740] rcceph is no longer used with (open)SUSE
authorOwen Synge <osynge@suse.com>
Thu, 11 Feb 2016 16:16:33 +0000 (17:16 +0100)
committerOwen Synge <osynge@suse.com>
Thu, 26 May 2016 12:20:44 +0000 (14:20 +0200)
rcceph is no longer used with (open)SUSE and has been removd from ceph upstream.
Hence it is best to start the services directly and make the service start code
identical to Fedora.

Signed-off-by: Owen Synge <osynge@suse.com>
ceph_deploy/hosts/suse/mon/create.py

index 5c0b9bfe890b18b9a3a4dffaf9f54f204a9b2040..7579aa797695a57024f8a5394f44c5e886f8628a 100644 (file)
@@ -1,4 +1,5 @@
 from ceph_deploy.hosts import common
+from ceph_deploy.util import system
 from ceph_deploy.lib import remoto
 
 
@@ -6,14 +7,50 @@ def create(distro, args, monitor_keyring):
     hostname = distro.conn.remote_module.shortname()
     common.mon_create(distro, args, monitor_keyring, hostname)
 
-    remoto.process.run(
-        distro.conn,
-        [
-            'rcceph',
-            '-c',
-            '/etc/ceph/{cluster}.conf'.format(cluster=args.cluster),
-            'start',
-            'mon.{hostname}'.format(hostname=hostname)
-        ],
-        timeout=7,
-    )
+    if distro.init == 'sysvinit':
+        service = distro.conn.remote_module.which_service()
+        remoto.process.run(
+            distro.conn,
+            [
+                service,
+                'ceph',
+                '-c',
+                '/etc/ceph/{cluster}.conf'.format(cluster=args.cluster),
+                'start',
+                'mon.{hostname}'.format(hostname=hostname)
+            ],
+            timeout=7,
+        )
+
+        system.enable_service(distro.conn)
+    elif distro.init == 'systemd':
+       # enable ceph target for this host (in case it isn't already enabled)
+        remoto.process.run(
+            distro.conn,
+            [
+                'systemctl',
+                'enable',
+                'ceph.target'
+            ],
+            timeout=7,
+        )
+
+        # enable and start this mon instance
+        remoto.process.run(
+            distro.conn,
+            [
+                'systemctl',
+                'enable',
+                'ceph-mon@{hostname}'.format(hostname=hostname),
+            ],
+            timeout=7,
+        )
+        remoto.process.run(
+            distro.conn,
+            [
+                'systemctl',
+                'start',
+                'ceph-mon@{hostname}'.format(hostname=hostname),
+            ],
+            timeout=7,
+        )