mirror of https://github.com/ceph/ceph-ansible.git
Merge pull request #766 from ceph/retry-sgdisk
try to zap a device again if sgdisk fails on the first trypull/770/head
commit
39bda5b41f
|
@ -74,8 +74,13 @@
|
||||||
register: journal_partition_status
|
register: journal_partition_status
|
||||||
when: raw_multi_journal
|
when: raw_multi_journal
|
||||||
|
|
||||||
|
# NOTE: The following calls to sgdisk are retried because sgdisk is known to
|
||||||
|
# fully wipe a device the first time around. There is no need to halt execution
|
||||||
|
# of zapping the whole device so these try again. It is easier to use `||` to
|
||||||
|
# keep the current flow of the task.
|
||||||
|
# See: https://github.com/ceph/ceph-ansible/issues/759
|
||||||
- name: fix partitions gpt header or labels of the osd disks
|
- name: fix partitions gpt header or labels of the osd disks
|
||||||
shell: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}
|
shell: "sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }} || sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}"
|
||||||
with_together:
|
with_together:
|
||||||
- combined_osd_partition_status_results.results
|
- combined_osd_partition_status_results.results
|
||||||
- devices
|
- devices
|
||||||
|
@ -86,7 +91,7 @@
|
||||||
item.0.rc != 0
|
item.0.rc != 0
|
||||||
|
|
||||||
- name: fix partitions gpt header or labels of the osd disks (autodiscover disks)
|
- name: fix partitions gpt header or labels of the osd disks (autodiscover disks)
|
||||||
shell: sgdisk --zap-all --clear --mbrtogpt -g -- "/dev/{{ item.1.key }}"
|
shell: "sgdisk --zap-all --clear --mbrtogpt -g -- '/dev/{{ item.1.key }}' || sgdisk --zap-all --clear --mbrtogpt -g -- '/dev/{{ item.1.key }}'"
|
||||||
with_together:
|
with_together:
|
||||||
- combined_osd_partition_status_results.results
|
- combined_osd_partition_status_results.results
|
||||||
- ansible_devices
|
- ansible_devices
|
||||||
|
@ -100,7 +105,7 @@
|
||||||
item.0.rc != 0
|
item.0.rc != 0
|
||||||
|
|
||||||
- name: fix partitions gpt header or labels of the journal devices
|
- name: fix partitions gpt header or labels of the journal devices
|
||||||
shell: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}
|
shell: "sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }} || shell: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}"
|
||||||
with_together:
|
with_together:
|
||||||
- journal_partition_status.results
|
- journal_partition_status.results
|
||||||
- raw_journal_devices
|
- raw_journal_devices
|
||||||
|
|
Loading…
Reference in New Issue