]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: ensure a gpt label is set on device 2197/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 17 Nov 2017 16:32:23 +0000 (17:32 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 17 Nov 2017 16:32:23 +0000 (17:32 +0100)
ceph-disk prepare will fail on jewel if a GPT label is not present on
device.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-osd/tasks/check_gpt.yml [new file with mode: 0644]
roles/ceph-osd/tasks/main.yml

diff --git a/roles/ceph-osd/tasks/check_gpt.yml b/roles/ceph-osd/tasks/check_gpt.yml
new file mode 100644 (file)
index 0000000..0cfc80e
--- /dev/null
@@ -0,0 +1,19 @@
+---
+- name: check the partition status of the osd disks
+  command: "parted --script {{ item }} print"
+  with_items:
+    - "{{ devices }}"
+  changed_when: false
+  failed_when: false
+  check_mode: no
+  register: osd_partition_status_results
+
+- name: create gpt disk label
+  command: parted --script {{ item.1 }} mklabel gpt
+  with_together:
+    - "{{ osd_partition_status_results.results }}"
+    - "{{ devices }}"
+  changed_when: false
+  when:
+    - not item.0.get("skipped")
+    - item.0.get("rc", 0) != 0
index 65234eff77536581c69b8b36f7c4fa01c762c5d2..ab91cdd5a24b959659dcf49c63136e69890f4cdf 100644 (file)
@@ -36,6 +36,9 @@
     - containerized_deployment
     - not containerized_deployment_with_kv
 
+- name: include check_gpt.yml
+  include: check_gpt.yml
+
 - name: include scenarios/collocated.yml
   include: scenarios/collocated.yml
   when: