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.
|
|
|
|
|
|
|
|
- name: Create OSD directories
|
2014-11-06 00:57:28 +08:00
|
|
|
file: >
|
|
|
|
path={{ item }}
|
|
|
|
state=directory
|
|
|
|
owner=root
|
2014-09-05 03:14:11 +08:00
|
|
|
group=root
|
2014-07-03 21:30:49 +08:00
|
|
|
with_items: osd_directories
|
|
|
|
|
|
|
|
# Prepare means
|
|
|
|
# - create GPT partition
|
|
|
|
# - mark the partition with the ceph type uuid
|
|
|
|
# - create a file system
|
|
|
|
# - mark the fs as ready for ceph consumption
|
|
|
|
# - entire data disk is used (one big partition)
|
|
|
|
# - a new partition is added to the journal disk (so it can be easily shared)
|
|
|
|
#
|
|
|
|
|
|
|
|
# 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)
|
2014-09-05 03:14:11 +08:00
|
|
|
command: "ceph-disk prepare {{ item }}"
|
2014-07-03 21:30:49 +08:00
|
|
|
when: osd_directory
|
|
|
|
with_items: osd_directories
|
2015-04-09 00:46:54 +08:00
|
|
|
changed_when: False
|
2014-07-03 21:30:49 +08:00
|
|
|
|
|
|
|
# Activate means:
|
|
|
|
# - mount the volume in a temp location
|
|
|
|
# - allocate an osd id (if needed)
|
|
|
|
# - remount in the correct location /var/lib/ceph/osd/$cluster-$id
|
|
|
|
# - start ceph-osd
|
|
|
|
#
|
|
|
|
|
|
|
|
- name: Activate OSD(s)
|
2014-09-05 03:14:11 +08:00
|
|
|
command: "ceph-disk activate {{ item }}"
|
2014-07-03 21:30:49 +08:00
|
|
|
with_items: osd_directories
|
|
|
|
changed_when: False
|
|
|
|
|
|
|
|
- name: Start and add that the OSD service to the init sequence
|
2014-09-05 03:14:11 +08:00
|
|
|
service: >
|
2014-11-06 00:57:28 +08:00
|
|
|
name=ceph
|
|
|
|
state=started
|
2014-09-05 03:14:11 +08:00
|
|
|
enabled=yes
|