]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Omit XFS options on older OSes 349/head
authorZack Cerza <zack@redhat.com>
Tue, 14 Nov 2017 01:05:06 +0000 (18:05 -0700)
committerZack Cerza <zack@redhat.com>
Tue, 14 Nov 2017 01:05:06 +0000 (18:05 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
roles/testnode/tasks/var_lib.yml

index 133b502e8de2ae937ef5dd9acb2ca7f1ec01751c..324dc681823b6ba97c49f0e618aa556578414519 100644 (file)
@@ -7,13 +7,19 @@
     path: "/var/lib/ceph"
     state: directory
 
+- name: Set xfs_opts on newer OSes
+  set_fact:
+    xfs_opts: "-m crc=0,finobt=0"
+  when: (ansible_distribution | lower == 'ubuntu' and ansible_distribution_major_version|int >= 16) or
+        (ansible_distribution | lower in ['centos', 'rhel'] and ansible_distribution_major_version|int >= 7)
+
 - name: "Create xfs filesystem on {{ var_lib_partition }}"
   filesystem:
     dev: "{{ var_lib_partition }}"
     fstype: xfs
     force: yes
     # Don't use a version 5 superblock as it's too new for some kernels
-    opts: "-m crc=0,finobt=0"
+    opts: "{{ xfs_opts|default('') }}"
 
 - name: "Mount {{ var_lib_partition }} to /var/lib/ceph"
   mount: