]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
update: use ids to restart osds instead of device name v3.2.24
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 13 Aug 2019 09:13:30 +0000 (11:13 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 13 Aug 2019 11:42:58 +0000 (13:42 +0200)
we must use the ids instead of device names in the tasks executed in
`post_tasks` for the osd rolling update otherwise it ends up with old
systemd units enabled.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1739209
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/rolling_update.yml

index 2a32b52154dd3b6fd5b4607fddacf55e9260b72d..c6cf3b92aebe42cd6d26cf638b17f3de0d4c5d46 100644 (file)
   become: True
 
   pre_tasks:
-    - name: get osd numbers - non container
+    - name: get osd numbers
       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@([a-z0-9]+).service"
-      register: osd_names
-      changed_when: false
-      when: containerized_deployment
 
     - name: stop ceph osd
       systemd:
     - ceph-osd
 
   post_tasks:
-    - name: get osd numbers
-      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: start ceph osd
+    - name: restart ceph osd
       systemd:
-        name: ceph-osd@{{ item }}
-        state: started
-        enabled: yes
-      with_items: "{{ osd_ids.stdout_lines }}"
-      when:
-        - not containerized_deployment
-
-    - name: restart containerized ceph osd
-      systemd:
-        name: "{{ item }}"
+        name: "ceph-osd@{{ item }}"
         state: restarted
         enabled: yes
         daemon_reload: yes
-      with_items: "{{ osd_names.stdout_lines }}"
-      when:
-        - containerized_deployment
+      with_items: "{{ osd_ids.stdout_lines }}"
 
     - name: set_fact docker_exec_cmd_osd
       set_fact: