From: Sébastien Han Date: Mon, 13 Aug 2018 13:59:25 +0000 (+0200) Subject: rolling_update: register container osd units X-Git-Tag: v3.0.43~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8327f3de0786e88cb4e89acb9b371ea8076fe98a;p=ceph-ansible.git rolling_update: register container osd units Before running the upgrade, let's call systemd to collect unit names instead of relaying on the device list. This is more accurate and fix the osd_auto_discovery scenario too. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1613626 Signed-off-by: Sébastien Han (cherry picked from commit dad10e8f3f67f1e0c6a14ef3e0b1f51f90d9d962) --- diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index f01168a97..63c254ef2 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -265,12 +265,18 @@ become: True pre_tasks: - - name: get osd numbers + - name: get osd numbers - non container shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi" register: osd_ids changed_when: false when: not containerized_deployment + - name: get osd unit names - container + shell: systemctl list-units | grep -E "loaded * active" | grep -oE "ceph-osd@([0-9]{1,}|[a-z]+).service" + register: osd_names + changed_when: false + when: containerized_deployment + - name: stop ceph osd systemd: name: ceph-osd@{{ item }} @@ -305,11 +311,11 @@ - name: restart containerized ceph osd systemd: - name: ceph-osd@{{ item | basename }} + name: "{{ item }}" state: restarted enabled: yes daemon_reload: yes - with_items: "{{ devices }}" + with_items: "{{ osd_names.stdout_lines }}" when: - containerized_deployment