From f90c051589aa20648fded2aa8affeba1e3bd82ee Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 11 Apr 2019 16:20:41 -0400 Subject: [PATCH] switch-from-non-containerized: stop all osds e6bfb84 introduced a regression in the switch from non containerized to container deployment. We need to stop all previous OSDs services. We just don't need the ceph-disk pattern in the regex. Signed-off-by: Dimitri Savineau (cherry picked from commit 150acba8c532f059f99a3724382c5f25fc91cdb4) --- ...ontainerized-to-containerized-ceph-daemons.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 4d6168f33..05dcf0a15 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -227,6 +227,21 @@ - import_role: name: ceph-defaults + - name: collect running osds + shell: | + systemctl list-units | grep "loaded active" | grep -Eo 'ceph-osd@[0-9]+.service|ceph-volume|ceph\.target' + register: running_osds + changed_when: false + failed_when: false + + - name: stop/disable/mask non-containerized ceph osd(s) (if any) + systemd: + name: "{{ item }}" + state: stopped + enabled: no + with_items: "{{ running_osds.stdout_lines | default([])}}" + when: running_osds != [] + - name: remove old ceph-osd systemd units file: path: "{{ item }}" -- 2.39.5