]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
validate: fix gpt header check
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 1 Oct 2019 07:34:14 +0000 (09:34 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Tue, 1 Oct 2019 17:02:45 +0000 (13:02 -0400)
Check for gpt header when osd scenario is lvm or lvm batch.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 272d16e101984de41bba6fcbe6134bf39e547341)

roles/ceph-validate/tasks/check_devices.yml

index b2568f779789a7f80647742202c8f358cd1168e1..ecfa37985e0145f846f3197816cc06a9689272df 100644 (file)
@@ -1,22 +1,27 @@
 ---
-- name: devices validation
-  when: devices is defined
+- name: check no gpt header is present when osd scenario is lvm/lvm-batch
   block:
     - name: read information about the devices
       parted:
-        device: "{{ item }}"
+        device: "{{ item.data if item.data_vg is undefined and lvm_volumes is defined else item if devices is defined else omit }}"
         unit: MiB
       register: parted_results
-      with_items: "{{ devices }}"
+      with_items: "{{ lvm_volumes | default(devices) }}"
+      when:
+        - inventory_hostname in groups.get(osd_group_name, [])
+        - (item.data is defined and item.data_vg is undefined) or devices is defined
 
     - name: fail when gpt header found on osd devices
       fail:
         msg: "{{ item.disk.dev }} has gpt header, please remove it."
       with_items: "{{ parted_results.results }}"
       when:
+        - item.skipped is undefined
         - item.disk.table == 'gpt'
         - item.partitions | length == 0
 
+- name: check devices are block devices
+  block:
     - name: get devices information
       parted:
         device: "{{ item }}"