2014-07-03 21:30:49 +08:00
|
|
|
---
|
|
|
|
## SCENARIO 4: USE A DIRECTORY INSTEAD OF A DISK FOR OSD
|
|
|
|
|
|
|
|
# NOTE (leseb): we do not check the filesystem underneath the directory
|
|
|
|
# so it is really up to you to configure this properly.
|
|
|
|
# Declaring more than one directory on the same filesystem will confuse Ceph.
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: create osd directories
|
2015-10-19 09:24:47 +08:00
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
2017-01-20 17:14:35 +08:00
|
|
|
owner: "ceph"
|
|
|
|
group: "ceph"
|
2016-11-03 17:16:33 +08:00
|
|
|
with_items: "{{ osd_directories }}"
|
2014-07-03 21:30:49 +08:00
|
|
|
|
|
|
|
# NOTE (leseb): the prepare process must be parallelized somehow...
|
|
|
|
# if you have 64 disks with 4TB each, this will take a while
|
|
|
|
# since Ansible will sequential process the loop
|
2017-02-01 20:59:35 +08:00
|
|
|
- name: prepare osd directory disk(s)
|
2016-03-29 21:37:31 +08:00
|
|
|
command: "ceph-disk prepare --cluster {{ cluster }} {{ item }}"
|
2016-11-03 17:16:33 +08:00
|
|
|
with_items: "{{ osd_directories }}"
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
|
|
|
when: osd_directory
|
2014-07-03 21:30:49 +08:00
|
|
|
|
2017-02-01 20:59:35 +08:00
|
|
|
- name: activate osd(s)
|
2014-09-05 03:14:11 +08:00
|
|
|
command: "ceph-disk activate {{ item }}"
|
2016-11-03 17:16:33 +08:00
|
|
|
with_items: "{{ osd_directories }}"
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2014-07-03 21:30:49 +08:00
|
|
|
|
2017-02-01 20:59:35 +08:00
|
|
|
- name: start and add osd target(s) to the systemd sequence
|
2016-03-08 07:01:54 +08:00
|
|
|
service:
|
|
|
|
name: ceph.target
|
|
|
|
state: started
|
|
|
|
enabled: yes
|