]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
create the mon/create.py files for all distros
authorAlfredo Deza <alfredo@deza.pe>
Fri, 2 Aug 2013 16:30:27 +0000 (12:30 -0400)
committerAlfredo Deza <alfredo@deza.pe>
Fri, 2 Aug 2013 16:30:27 +0000 (12:30 -0400)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
12 files changed:
ceph_deploy/hosts/centos/__init__.py
ceph_deploy/hosts/centos/mon/__init__.py [new file with mode: 0644]
ceph_deploy/hosts/centos/mon/create.py [new file with mode: 0644]
ceph_deploy/hosts/debian/__init__.py
ceph_deploy/hosts/debian/mon/__init__.py [new file with mode: 0644]
ceph_deploy/hosts/debian/mon/create.py [new file with mode: 0644]
ceph_deploy/hosts/fedora/__init__.py
ceph_deploy/hosts/fedora/mon/__init__.py [new file with mode: 0644]
ceph_deploy/hosts/fedora/mon/create.py [new file with mode: 0644]
ceph_deploy/hosts/suse/__init__.py
ceph_deploy/hosts/suse/mon/__init__.py [new file with mode: 0644]
ceph_deploy/hosts/suse/mon/create.py [new file with mode: 0644]

index 416e3af3a71a8c3d97e68fd92a3cbee9f1429a73..c3fe2f81eaf878b453698761a31bf2d33b95734c 100644 (file)
@@ -1,3 +1,4 @@
+import mon
 from install import install
 
 # Allow to set some information about this distro
diff --git a/ceph_deploy/hosts/centos/mon/__init__.py b/ceph_deploy/hosts/centos/mon/__init__.py
new file mode 100644 (file)
index 0000000..fca0e0d
--- /dev/null
@@ -0,0 +1 @@
+from create import create
diff --git a/ceph_deploy/hosts/centos/mon/create.py b/ceph_deploy/hosts/centos/mon/create.py
new file mode 100644 (file)
index 0000000..4552ea4
--- /dev/null
@@ -0,0 +1,18 @@
+from ceph_deploy.util.wrappers import check_call
+from ceph_deploy.hosts import common
+
+
+def create(distro, logger, args, monitor_keyring):
+    hostname = distro.sudo_conn.modules.socket.gethostname().split('.')[0]
+    common.mon_create(distro, logger, args, monitor_keyring, hostname)
+
+    check_call(
+        distro.sudo_conn,
+        logger,
+        [
+            '/sbin/service',
+            'ceph',
+            'start',
+            'mon.{hostname}'.format(hostname=hostname)
+        ],
+    )
index 416e3af3a71a8c3d97e68fd92a3cbee9f1429a73..c3fe2f81eaf878b453698761a31bf2d33b95734c 100644 (file)
@@ -1,3 +1,4 @@
+import mon
 from install import install
 
 # Allow to set some information about this distro
diff --git a/ceph_deploy/hosts/debian/mon/__init__.py b/ceph_deploy/hosts/debian/mon/__init__.py
new file mode 100644 (file)
index 0000000..fca0e0d
--- /dev/null
@@ -0,0 +1 @@
+from create import create
diff --git a/ceph_deploy/hosts/debian/mon/create.py b/ceph_deploy/hosts/debian/mon/create.py
new file mode 100644 (file)
index 0000000..970d6b3
--- /dev/null
@@ -0,0 +1,32 @@
+from ceph_deploy.util.wrappers import check_call
+from ceph_deploy.hosts import common
+
+
+def create(distro, logger, args, monitor_keyring):
+    hostname = distro.sudo_conn.modules.socket.gethostname().split('.')[0]
+    common.mon_create(distro, logger, args, monitor_keyring, hostname)
+
+    if distro.name.lower() == 'ubuntu':
+        check_call(
+            distro.sudo_conn,
+            logger,
+            [
+                'initctl',
+                'emit',
+                'ceph-mon',
+                'cluster={cluster}'.format(cluster=args.cluster),
+                'id={hostname}'.format(hostname=hostname),
+            ],
+        )
+
+    else:  # Debian doesn't use initctl
+        check_call(
+            distro.sudo_conn,
+            logger,
+            [
+                '/sbin/service',
+                'ceph',
+                'start',
+                'mon.{hostname}'.format(hostname=hostname)
+            ],
+        )
index 416e3af3a71a8c3d97e68fd92a3cbee9f1429a73..c3fe2f81eaf878b453698761a31bf2d33b95734c 100644 (file)
@@ -1,3 +1,4 @@
+import mon
 from install import install
 
 # Allow to set some information about this distro
diff --git a/ceph_deploy/hosts/fedora/mon/__init__.py b/ceph_deploy/hosts/fedora/mon/__init__.py
new file mode 100644 (file)
index 0000000..fca0e0d
--- /dev/null
@@ -0,0 +1 @@
+from create import create
diff --git a/ceph_deploy/hosts/fedora/mon/create.py b/ceph_deploy/hosts/fedora/mon/create.py
new file mode 100644 (file)
index 0000000..4552ea4
--- /dev/null
@@ -0,0 +1,18 @@
+from ceph_deploy.util.wrappers import check_call
+from ceph_deploy.hosts import common
+
+
+def create(distro, logger, args, monitor_keyring):
+    hostname = distro.sudo_conn.modules.socket.gethostname().split('.')[0]
+    common.mon_create(distro, logger, args, monitor_keyring, hostname)
+
+    check_call(
+        distro.sudo_conn,
+        logger,
+        [
+            '/sbin/service',
+            'ceph',
+            'start',
+            'mon.{hostname}'.format(hostname=hostname)
+        ],
+    )
index 416e3af3a71a8c3d97e68fd92a3cbee9f1429a73..c3fe2f81eaf878b453698761a31bf2d33b95734c 100644 (file)
@@ -1,3 +1,4 @@
+import mon
 from install import install
 
 # Allow to set some information about this distro
diff --git a/ceph_deploy/hosts/suse/mon/__init__.py b/ceph_deploy/hosts/suse/mon/__init__.py
new file mode 100644 (file)
index 0000000..fca0e0d
--- /dev/null
@@ -0,0 +1 @@
+from create import create
diff --git a/ceph_deploy/hosts/suse/mon/create.py b/ceph_deploy/hosts/suse/mon/create.py
new file mode 100644 (file)
index 0000000..4552ea4
--- /dev/null
@@ -0,0 +1,18 @@
+from ceph_deploy.util.wrappers import check_call
+from ceph_deploy.hosts import common
+
+
+def create(distro, logger, args, monitor_keyring):
+    hostname = distro.sudo_conn.modules.socket.gethostname().split('.')[0]
+    common.mon_create(distro, logger, args, monitor_keyring, hostname)
+
+    check_call(
+        distro.sudo_conn,
+        logger,
+        [
+            '/sbin/service',
+            'ceph',
+            'start',
+            'mon.{hostname}'.format(hostname=hostname)
+        ],
+    )