update: fix ceph-crash stop task

This is a workaround for an issue in ansible.
When trying to stop/mask/disable this service in one task, the stop
didn't actually happen, the task doesn't fail but for some reason the
container is still present and running.
Then the task starting the service in the role ceph-crash fails because
it can't start the container since it's already running with the same
name.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1955393

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 3db1ea7ec4)
(cherry picked from commit 2d59f4579b)
4.2z1 v4.0.49.3
Guillaume Abrioux 2021-05-04 11:42:15 +02:00
parent 7048815679
commit 6646565db9
1 changed files with 6 additions and 0 deletions

View File

@ -880,6 +880,12 @@
systemd: systemd:
name: "{{ 'ceph-crash@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-crash.service' }}" name: "{{ 'ceph-crash@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-crash.service' }}"
state: stopped state: stopped
daemon_reload: yes
# it needs to be done in a separate task otherwise the stop just before doesn't work.
- name: mask and disable the ceph-crash service
systemd:
name: "{{ 'ceph-crash@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-crash.service' }}"
enabled: no enabled: no
masked: yes masked: yes