mirror of https://github.com/ceph/ceph-ansible.git
Revert "ceph-validate: check block presence first"
This reverts commit 4f89cdcd45
.
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
pull/6690/head
parent
57f9553798
commit
a684a26428
|
@ -54,6 +54,27 @@
|
||||||
msg: "{{ root_device }} found in either lvm_volumes or devices variable"
|
msg: "{{ root_device }} found in either lvm_volumes or devices variable"
|
||||||
when: root_device in lvm_volumes_data_devices | default([]) or root_device in _devices | default([])
|
when: root_device in lvm_volumes_data_devices | default([]) or root_device in _devices | default([])
|
||||||
|
|
||||||
|
- name: check no gpt header is present when osd scenario is lvm/lvm-batch
|
||||||
|
block:
|
||||||
|
- name: read information about the devices
|
||||||
|
parted:
|
||||||
|
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: "{{ 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
|
- name: check devices are block devices
|
||||||
block:
|
block:
|
||||||
- name: get devices information
|
- name: get devices information
|
||||||
|
@ -62,21 +83,10 @@
|
||||||
unit: MiB
|
unit: MiB
|
||||||
register: devices_parted
|
register: devices_parted
|
||||||
failed_when: False
|
failed_when: False
|
||||||
with_items:
|
with_items: "{{ devices | default([]) }}"
|
||||||
- "{{ devices | default([]) }}"
|
|
||||||
- "{{ lvm_volumes_data_devices | default([]) }}"
|
|
||||||
|
|
||||||
- name: fail if one of the devices is not a device
|
- name: fail if one of the devices is not a device
|
||||||
fail:
|
fail:
|
||||||
msg: "{{ item.item }} is not a block special file!"
|
msg: "{{ item.item }} is not a block special file!"
|
||||||
when: item.rc is defined
|
when: item.rc is defined
|
||||||
with_items: "{{ devices_parted.results }}"
|
with_items: "{{ devices_parted.results }}"
|
||||||
|
|
||||||
- name: fail when gpt header found on osd devices
|
|
||||||
fail:
|
|
||||||
msg: "{{ item.disk.dev }} has gpt header, please remove it."
|
|
||||||
with_items: "{{ devices_parted.results }}"
|
|
||||||
when:
|
|
||||||
- item.skipped is undefined
|
|
||||||
- item.disk.table == 'gpt'
|
|
||||||
- item.partitions | length == 0
|
|
||||||
|
|
Loading…
Reference in New Issue