From 84f66ea21411253df4c59a5986e3e70ff08b8af9 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 17 Nov 2017 17:32:23 +0100 Subject: [PATCH] osd: ensure a gpt label is set on device MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ceph-disk prepare will fail on jewel if a GPT label is not present on device. Signed-off-by: Guillaume Abrioux (cherry picked from commit efe06be10ff6215fcc8a42919014650287b99ab7) Signed-off-by: Sébastien Han --- roles/ceph-osd/tasks/check_gpt.yml | 19 +++++++++++++++++++ roles/ceph-osd/tasks/main.yml | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 roles/ceph-osd/tasks/check_gpt.yml diff --git a/roles/ceph-osd/tasks/check_gpt.yml b/roles/ceph-osd/tasks/check_gpt.yml new file mode 100644 index 000000000..0cfc80ef5 --- /dev/null +++ b/roles/ceph-osd/tasks/check_gpt.yml @@ -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 diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml index be801dd7b..9a8bd1e6d 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -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: -- 2.47.3