2014-03-10 23:52:31 +08:00
|
|
|
---
|
|
|
|
## SCENARIO 1: JOURNAL AND OSD_DATA ON THE SAME DEVICE
|
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ../check_devices.yml
|
2014-03-10 23:52:31 +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
|
|
|
|
|
2014-06-26 20:19:09 +08:00
|
|
|
# NOTE (alahouze): if the device is a partition, the parted command below has
|
|
|
|
# failed, this is why we check if the device is a partition too.
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: automatic prepare osd disk(s) without partitions
|
2016-03-29 21:37:31 +08:00
|
|
|
command: ceph-disk prepare --cluster "{{ cluster }}" "/dev/{{ item.key }}"
|
2015-06-26 06:26:03 +08:00
|
|
|
ignore_errors: true
|
2014-11-13 22:19:18 +08:00
|
|
|
register: prepared_osds
|
2015-06-26 06:26:03 +08:00
|
|
|
with_dict: ansible_devices
|
|
|
|
when:
|
|
|
|
ansible_devices is defined and
|
|
|
|
item.value.removable == "0" and
|
|
|
|
item.value.partitions|count == 0 and
|
|
|
|
journal_collocation and
|
|
|
|
osd_auto_discovery
|
2014-06-26 20:19:09 +08:00
|
|
|
|
2016-02-12 05:40:59 +08:00
|
|
|
- name: manually prepare osd disk(s)
|
2016-03-29 21:37:31 +08:00
|
|
|
command: "ceph-disk prepare --cluster {{ cluster }} {{ item.2 }}"
|
2015-06-26 06:26:03 +08:00
|
|
|
ignore_errors: true
|
|
|
|
with_together:
|
2016-02-12 07:54:09 +08:00
|
|
|
- combined_parted_results.results
|
|
|
|
- combined_ispartition_results.results
|
2015-06-26 06:26:03 +08:00
|
|
|
- devices
|
2015-06-26 05:40:07 +08:00
|
|
|
when:
|
2016-02-25 00:25:26 +08:00
|
|
|
not item.0.get("skipped") and
|
|
|
|
not item.1.get("skipped") and
|
|
|
|
item.0.get("rc", 0) != 0 and
|
|
|
|
item.1.get("rc", 0) != 0 and
|
2015-06-26 05:40:07 +08:00
|
|
|
journal_collocation and not
|
|
|
|
osd_auto_discovery
|
2014-03-10 23:52:31 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- include: ../activate_osds.yml
|