From 88eda479a9d6df6224a24f56dbcbdb204daab150 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 10 Jan 2019 11:26:19 -0600 Subject: [PATCH] ceph-facts: generate devices when osd_auto_discovery is true This task used to live in ceph-osd, but we need it defined here to that ceph-config can use it when trying to determine the number of osds. Signed-off-by: Andrew Schoen --- roles/ceph-facts/tasks/facts.yml | 13 +++++++++++++ roles/ceph-osd/tasks/build_devices.yml | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 854f23b53..60a16db81 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -173,6 +173,19 @@ - not osd_auto_discovery|default(False) - osd_scenario|default('dummy') != 'lvm' +- name: set_fact devices generate device list when osd_auto_discovery + set_fact: + devices: "{{ devices | default([]) + [ item.key | regex_replace('^', '/dev/') ] }}" + with_dict: "{{ ansible_devices }}" + when: + - osd_auto_discovery|default(False) + - ansible_devices is defined + - item.value.removable == "0" + - item.value.sectors != "0" + - item.value.partitions|count == 0 + - item.value.holders|count == 0 + - "'dm-' not in item.key" + - name: set_fact ceph_uid for debian based system - non container set_fact: ceph_uid: 64045 diff --git a/roles/ceph-osd/tasks/build_devices.yml b/roles/ceph-osd/tasks/build_devices.yml index b578c320f..350e085d3 100644 --- a/roles/ceph-osd/tasks/build_devices.yml +++ b/roles/ceph-osd/tasks/build_devices.yml @@ -1,17 +1,4 @@ --- -- name: set_fact devices generate device list when osd_auto_discovery - set_fact: - devices: "{{ devices | default([]) + [ item.key | regex_replace('^', '/dev/') ] }}" - with_dict: "{{ ansible_devices }}" - when: - - osd_auto_discovery - - ansible_devices is defined - - item.value.removable == "0" - - item.value.sectors != "0" - - item.value.partitions|count == 0 - - item.value.holders|count == 0 - - "'dm-' not in item.key" - - name: resolve dedicated device link(s) command: readlink -f {{ item }} changed_when: false