mirror of https://github.com/ceph/ceph-ansible.git
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
---
|
|
## SCENARIO 3: N JOURNAL DEVICES FOR N OSDS
|
|
|
|
- include: ../check_devices.yml
|
|
|
|
# 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
|
|
|
|
# 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.
|
|
- name: prepare osd disk(s)
|
|
command: "ceph-disk prepare --cluster {{ cluster }} {{ item.2 }} {{ item.3 }}"
|
|
with_together:
|
|
- combined_parted_results.results
|
|
- combined_ispartition_results.results
|
|
- devices
|
|
- raw_journal_devices
|
|
changed_when: false
|
|
ignore_errors: true
|
|
register: prepare_osd_disk
|
|
when:
|
|
- not item.0.get("skipped")
|
|
- not item.1.get("skipped")
|
|
- item.0.get("rc", 0) != 0
|
|
- item.1.get("rc", 0) != 0
|
|
- raw_multi_journal
|
|
- not osd_auto_discovery
|
|
|
|
- name: fail if ceph-disk cannot prepare an OSD
|
|
fail:
|
|
msg: "ceph-disk failed to prepare an OSD"
|
|
when:
|
|
- " 'ceph-disk: Error:' in item.get('stderr', '') "
|
|
- " 'Failed to add' in item.get('stderr', '') "
|
|
- item.get("rc") != 0
|
|
with_items: "{{prepare_osd_disk.results}}"
|
|
|
|
- include: ../activate_osds.yml
|