]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
update: fix ceph-crash stop task
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 4 May 2021 09:42:15 +0000 (11:42 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 4 May 2021 11:06:47 +0000 (13:06 +0200)
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>
infrastructure-playbooks/rolling_update.yml

index 757a8714cd36716f6e3065f214f84c59b0d41760..e0847e3d53d8a9a5e0483979a5f967632ac7ed42 100644 (file)
       systemd:
         name: "{{ 'ceph-crash@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-crash.service' }}"
         state: stopped
+
+    # 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
         masked: yes
+
     - import_role:
         name: ceph-defaults
     - import_role: