From 63b7e3d36ca14348b806c16d98c64892c93226df Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Tue, 25 Jul 2017 16:48:13 -0500 Subject: [PATCH] lvm_osds: ensure osd daemons are started Signed-off-by: Andrew Schoen --- roles/ceph-osd/tasks/activate_osds.yml | 18 ------------------ roles/ceph-osd/tasks/main.yml | 7 +++++++ roles/ceph-osd/tasks/start_osds.yml | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 roles/ceph-osd/tasks/start_osds.yml diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index 79b99c139..f420dfdaf 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -81,21 +81,3 @@ - not item.0.get("skipped") - item.0.get("rc", 0) == 0 - not osd_auto_discovery - -- include: osd_fragment.yml - when: crush_location - -- name: get osd id - shell: | - ls /var/lib/ceph/osd/ | sed 's/.*-//' - changed_when: false - failed_when: false - always_run: true - register: osd_id - -- name: start and add that the osd service(s) to the init sequence - service: - name: ceph-osd@{{ item }} - state: started - with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}" - changed_when: false diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml index 299d7f933..56d4c7d20 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -28,6 +28,13 @@ # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) static: False +- name: ensure OSD daemons are started + include: start_osds.yml + when: + - not containerized_deployment + # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) + static: False + - include: ./docker/main.yml when: containerized_deployment # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent) diff --git a/roles/ceph-osd/tasks/start_osds.yml b/roles/ceph-osd/tasks/start_osds.yml new file mode 100644 index 000000000..207902d8f --- /dev/null +++ b/roles/ceph-osd/tasks/start_osds.yml @@ -0,0 +1,19 @@ +--- + +- include: osd_fragment.yml + when: crush_location + +- name: get osd id + shell: | + ls /var/lib/ceph/osd/ | sed 's/.*-//' + changed_when: false + failed_when: false + always_run: true + register: osd_id + +- name: start and add that the osd service(s) to the init sequence + service: + name: ceph-osd@{{ item }} + state: started + with_items: "{{ (osd_id|default({})).stdout_lines|default([]) }}" + changed_when: false -- 2.39.5