2016-07-19 23:53:21 +08:00
|
|
|
---
|
|
|
|
## SCENARIO 5: DMCRYPT
|
|
|
|
|
|
|
|
- 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.
|
2016-07-19 23:55:57 +08:00
|
|
|
- name: automatic prepare osd disk(s) without partitions (dmcrypt)
|
2016-07-19 23:53:21 +08:00
|
|
|
command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "/dev/{{ item.key }}"
|
2016-11-03 17:16:33 +08:00
|
|
|
with_dict: "{{ ansible_devices }}"
|
2016-07-19 23:53:21 +08:00
|
|
|
when:
|
|
|
|
- ansible_devices is defined
|
|
|
|
- item.value.removable == "0"
|
|
|
|
- item.value.partitions|count == 0
|
2016-08-10 16:34:23 +08:00
|
|
|
- dmcrypt_journal_collocation
|
2016-07-19 23:53:21 +08:00
|
|
|
- osd_auto_discovery
|
|
|
|
|
2016-07-19 23:55:57 +08:00
|
|
|
- name: manually prepare osd disk(s) (dmcrypt)
|
2016-07-19 23:53:21 +08:00
|
|
|
command: ceph-disk prepare --dmcrypt --cluster "{{ cluster }}" "{{ item.2 }}"
|
|
|
|
with_together:
|
2016-11-03 17:16:33 +08:00
|
|
|
- "{{ parted_results.results }}"
|
|
|
|
- "{{ ispartition_results.results }}"
|
|
|
|
- "{{ devices }}"
|
2016-07-19 23:53:21 +08:00
|
|
|
when:
|
|
|
|
- not item.0.get("skipped")
|
|
|
|
- not item.1.get("skipped")
|
|
|
|
- item.0.get("rc", 0) != 0
|
|
|
|
- item.1.get("rc", 0) != 0
|
2016-08-10 16:34:23 +08:00
|
|
|
- dmcrypt_journal_collocation
|
2016-07-19 23:53:21 +08:00
|
|
|
- not osd_auto_discovery
|
|
|
|
|
|
|
|
- include: ../activate_osds.yml
|