---
## SCENARIO 3: N JOURNAL DEVICES FOR N OSDS

- include: zap_devices.yml
- 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 {{ item.2 }} {{ item.3 }}"
  when: (item.0.rc != 0 or item.1.rc != 0) and raw_multi_journal
  ignore_errors: True
  with_together:
    - parted.results
    - ispartition.results
    - devices
    - raw_journal_devices
  changed_when: False

- include: activate_osds.yml

---
## SCENARIO 3: N JOURNAL DEVICES FOR N OSDS

- include: zap_devices.yml
- 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 {{ item.2 }} {{ item.3 }}"
  when: item.0.rc != 0 and
        item.1.rc != 0 and
        raw_multi_journal
  ignore_errors: True
  with_together:
    - parted.results
    - ispartition.results
    - devices
    - raw_journal_devices
  changed_when: False

- include: activate_osds.yml

Correct the logic for running 'ceph-disk prepare'
Correct the logic for running 'ceph-disk prepare'

The logic was broken here for repeated runs.  We only want to run
'ceph-disk prepare' when the disk does not contain a ceph partition, is
not a partition, and raw_multi_journal is set.  Previously it would
attempt to run 'ceph-disk prepare' when there was a ceph partition
because the second half of the 'or' was still true since it isn't a
partition.
