]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Fix MDS creation for version >= 0.84 227/head
authorSébastien Han <sebastien.han@enovance.com>
Thu, 12 Mar 2015 03:50:38 +0000 (22:50 -0500)
committerSébastien Han <sebastien.han@enovance.com>
Thu, 12 Mar 2015 03:50:38 +0000 (22:50 -0500)
The ceph fs new command was introduced in Ceph 0.84. Prior to this
release, no manual steps are required to create a filesystem, and pools
named data and metadata exist by default.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
roles/ceph-mon/defaults/main.yml
roles/ceph-mon/tasks/create_mds_filesystems.yml [new file with mode: 0644]
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/tasks/main.yml

index 74728971d7ff3456d25b4200a71219dce41682f6..2240dab77974cff1077136be6906ef9c18864091 100644 (file)
@@ -14,6 +14,11 @@ cephx: true
 # referenced in common role too.\r
 radosgw: false\r
 \r
+# CephFS\r
+pool_default_pg_num: 128\r
+cephfs_data: cephfs_data\r
+cephfs_metadata: cephfs_metadata\r
+cephfs: cephfs\r
 \r
 #############\r
 # OPENSTACK #\r
diff --git a/roles/ceph-mon/tasks/create_mds_filesystems.yml b/roles/ceph-mon/tasks/create_mds_filesystems.yml
new file mode 100644 (file)
index 0000000..4ebedbc
--- /dev/null
@@ -0,0 +1,9 @@
+---
+- name: Create filesystem pools
+  command: ceph osd pool create {{ item }} {{ pool_default_pg_num }}
+  with_items:
+    - cephfs_data
+    - cephfs_metadata
+
+- name: Create Ceph Filesystem
+  command: ceph fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
index 59806cc218608da63bae219bb13eedf0fde830e5..3721f16b9eeba448370203a82ac58a1af0abf58b 100644 (file)
@@ -26,3 +26,7 @@
     state=started
     enabled=yes
     args=mon
+
+- name: Get Ceph monitor version
+  shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
+  register: ceph_version
index 0a7415374420497195495a6651dfb64e5901dc41..24a470f273c2c4df2a6a4784904ce7a8142e3460 100644 (file)
@@ -5,8 +5,8 @@
 - include: ceph_keys.yml
   when: not ceph_containerized_deployment
 
-- include: ceph_keys.yml
-  when: not ceph_containerized_deployment
+- include: create_mds_filesystems.yml
+  when: not ceph_containerized_deployment and not {{ ceph_version.stdout | version_compare('0.84', '<') }}
 
 - include: docker.yml
   when: ceph_containerized_deployment