Commit 787a6e87 authored by Guillaume Abrioux's avatar Guillaume Abrioux
Browse files

update: use ids to restart osds instead of device name

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: default avatarGuillaume Abrioux <gabrioux@redhat.com>
parent 81906344
...@@ -340,17 +340,10 @@ ...@@ -340,17 +340,10 @@
become: True become: True
pre_tasks: 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" shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi"
register: osd_ids register: osd_ids
changed_when: false 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 - name: stop ceph osd
systemd: systemd:
...@@ -371,30 +364,13 @@ ...@@ -371,30 +364,13 @@
- ceph-osd - ceph-osd
post_tasks: post_tasks:
- name: get osd numbers - name: restart ceph osd
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
systemd: systemd:
name: ceph-osd@{{ item }} 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 }}"
state: restarted state: restarted
enabled: yes enabled: yes
daemon_reload: yes daemon_reload: yes
with_items: "{{ osd_names.stdout_lines }}" with_items: "{{ osd_ids.stdout_lines }}"
when:
- containerized_deployment
- name: set_fact docker_exec_cmd_osd - name: set_fact docker_exec_cmd_osd
set_fact: set_fact:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment