2015-03-12 11:50:38 +08:00
|
|
|
---
|
2015-06-24 21:51:54 +08:00
|
|
|
# NOTE (leseb): in the present playbook the conditional is done on the task
|
|
|
|
# We don't do this in main.yml because of the 'docker' variable, when set to true
|
|
|
|
# the role 'ceph-common' doesn't get inherited so the condition can not be evaluate
|
|
|
|
# since those check are performed by the ceph-common role
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: create filesystem pools
|
2016-12-05 21:21:54 +08:00
|
|
|
command: ceph --cluster {{ cluster }} osd pool create {{ item }} {{ osd_pool_default_pg_num }}
|
2015-03-12 11:50:38 +08:00
|
|
|
with_items:
|
|
|
|
- cephfs_data
|
|
|
|
- cephfs_metadata
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-03-12 11:50:38 +08:00
|
|
|
|
2017-02-23 23:06:04 +08:00
|
|
|
- name: check if ceph filesystem already exists
|
|
|
|
command: ceph --cluster {{ cluster }} fs get {{ cephfs }}
|
|
|
|
register: check_existing_cephfs
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
when: inventory_hostname == groups.mons|last
|
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: create ceph filesystem
|
2016-03-29 21:37:31 +08:00
|
|
|
command: ceph --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2017-02-23 23:06:04 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname == groups.mons|last
|
|
|
|
- check_existing_cephfs.rc != 0
|
2016-10-04 23:40:20 +08:00
|
|
|
|
|
|
|
- name: allow multimds
|
|
|
|
command: ceph --cluster {{ cluster }} fs set {{ cephfs }} allow_multimds true --yes-i-really-mean-it
|
|
|
|
changed_when: false
|
|
|
|
when:
|
2017-02-23 23:06:04 +08:00
|
|
|
- ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel
|
|
|
|
- mds_allow_multimds
|
2016-10-04 23:40:20 +08:00
|
|
|
|
|
|
|
- name: set max_mds
|
|
|
|
command: ceph --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}
|
|
|
|
changed_when: false
|
|
|
|
when:
|
2017-02-23 23:06:04 +08:00
|
|
|
- ceph_release_num.{{ ceph_release }} >= ceph_release_num.jewel
|
|
|
|
- mds_allow_multimds
|
|
|
|
- mds_max_mds > 1
|