mirror of https://github.com/ceph/ceph-ansible.git
validate: fail if gpt header found on unprepared devices
ceph-volume will complain if gpt headers are found on devices.
This commit checks whether a gpt header is present on devices passed in
`devices` variable and fail early.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1730541
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 487d701685
)
pull/4249/head
parent
2c64166eac
commit
4aa4496fc1
|
@ -2,6 +2,21 @@
|
||||||
- name: devices validation
|
- name: devices validation
|
||||||
when: devices is defined
|
when: devices is defined
|
||||||
block:
|
block:
|
||||||
|
- name: read information about the devices
|
||||||
|
parted:
|
||||||
|
device: "{{ item }}"
|
||||||
|
unit: MiB
|
||||||
|
register: parted_results
|
||||||
|
with_items: "{{ devices }}"
|
||||||
|
|
||||||
|
- 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.disk.table == 'gpt'
|
||||||
|
- item.partitions | length == 0
|
||||||
|
|
||||||
- name: get devices information
|
- name: get devices information
|
||||||
parted:
|
parted:
|
||||||
device: "{{ item }}"
|
device: "{{ item }}"
|
||||||
|
|
Loading…
Reference in New Issue