mirror of https://github.com/ceph/ceph-ansible.git
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
---
|
|
## 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.
|
|
- name: create osd directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: "{{ dir_owner }}"
|
|
group: "{{ dir_group }}"
|
|
with_items: osd_directories
|
|
|
|
# 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
|
|
- name: prepare OSD disk(s)
|
|
command: "ceph-disk prepare --cluster {{ cluster }} {{ item }}"
|
|
with_items: osd_directories
|
|
changed_when: false
|
|
when: osd_directory
|
|
|
|
- name: activate OSD(s)
|
|
command: "ceph-disk activate {{ item }}"
|
|
with_items: osd_directories
|
|
changed_when: false
|
|
|
|
- name: start and add that the OSD service to the init sequence
|
|
service:
|
|
name: ceph
|
|
state: started
|
|
enabled: yes
|
|
when: ansible_service_mgr != "systemd"
|
|
|
|
- name: start and add the OSD target to the systemd sequence
|
|
service:
|
|
name: ceph.target
|
|
state: started
|
|
enabled: yes
|
|
when: ansible_service_mgr == "systemd"
|