mirror of https://github.com/ceph/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 <seb@redhat.com>pull/3036/head
parent
3149b2564f
commit
dad10e8f3f
|
@ -334,12 +334,18 @@
|
||||||
become: True
|
become: True
|
||||||
|
|
||||||
pre_tasks:
|
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"
|
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
|
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
|
- name: stop ceph osd
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-osd@{{ item }}
|
name: ceph-osd@{{ item }}
|
||||||
|
@ -374,11 +380,11 @@
|
||||||
|
|
||||||
- name: restart containerized ceph osd
|
- name: restart containerized ceph osd
|
||||||
systemd:
|
systemd:
|
||||||
name: ceph-osd@{{ item | basename }}
|
name: "{{ item }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
with_items: "{{ devices }}"
|
with_items: "{{ osd_names.stdout_lines }}"
|
||||||
when:
|
when:
|
||||||
- containerized_deployment
|
- containerized_deployment
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue