Fixes: http://tracker.ceph.com/issues/15951
Signed-off-by: David Galloway <dgallowa@redhat.com>
tags:
- hostname
+- include: zap_disks.yml
+ tags:
+ - zap
+
# partition drives, if any are requested
- include: drive_partitioning.yml
when: drive_to_partition is defined
--- /dev/null
+---
+- name: Make sure gdisk is installed
+ package:
+ name: gdisk
+ state: present
+
+- name: Set root disk
+ set_fact:
+ root_disk: "{{ item.device|regex_replace('[0-9]+', '') }}"
+ with_items: "{{ ansible_mounts }}"
+ when: item.mount == '/'
+
+- name: Zap all non-root disks
+ command: sgdisk --zap-all "/dev/{{ item.key }}"
+ with_dict: "{{ ansible_devices }}"
+ when: item.key not in root_disk