Merge pull request #439 from ceph/proactive-dev-check

Check partition status
pull/443/head
Leseb 2015-11-23 17:01:54 +01:00
commit 0bb56f7a51
1 changed files with 34 additions and 0 deletions

View File

@ -17,6 +17,40 @@
failed_when: false failed_when: false
register: ispartition register: ispartition
- name: check the partition status of the osd disks
shell: "parted --script {{ item }} print > /dev/null 2>&1"
with_items: devices
changed_when: false
failed_when: false
register: osd_partition_status
when:
journal_collocation or
raw_multi_journal
- name: check the partition status of the journal devices
shell: "parted --script {{ item }} print > /dev/null 2>&1"
with_items: raw_journal_devices
changed_when: false
failed_when: false
register: journal_partition_status
when: raw_multi_journal
- name: fix partitions gpt header or labels of the osd disks
shell: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}
with_together:
- osd_partition_status.results
- devices
changed_when: false
when: (journal_collocation or raw_multi_journal) and item.0.rc != 0
- name: fix partitions gpt header or labels of the journal devices
shell: sgdisk --zap-all --clear --mbrtogpt -g -- {{ item.1 }}
with_together:
- journal_partition_status.results
- raw_journal_devices
changed_when: false
when: raw_multi_journal and item.0.rc != 0
- name: if partition named 'ceph' exists - name: if partition named 'ceph' exists
shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'" shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
with_items: devices with_items: devices