From 70f1eea9b2e44d759d5daec0e7b3bdabcbbebdcb Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 12 Feb 2019 10:56:28 +0100 Subject: [PATCH] switch_to_containers: remove non-containerized systemd unit files remove old systemd unit files (non-containerized) during the switch_to_containers transition. We have seen sometimes the unit started is the old one instead of the new systemd unit generated. Signed-off-by: Guillaume Abrioux --- ...inerized-to-containerized-ceph-daemons.yml | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 987cc1b42..ff3fcd6d3 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -69,6 +69,14 @@ state: stopped enabled: no + - name: remove old systemd unit files + file: + path: /usr/lib/systemd/system/{{ item }} + state: absent + with_items: + - ceph-mon@.service + - ceph-mon.target + - name: set_fact ceph_uid for ubuntu set_fact: ceph_uid: 64045 @@ -159,6 +167,14 @@ enabled: no failed_when: false + - name: remove old systemd unit files + file: + path: /usr/lib/systemd/system/{{ item }} + state: absent + with_items: + - ceph-mgr@.service + - ceph-mgr.target + - set_fact: ceph_uid: 64045 when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") @@ -234,7 +250,6 @@ - /usr/lib/systemd/system/ceph-osd.target - /usr/lib/systemd/system/ceph-osd@.service - /usr/lib/systemd/system/ceph-volume@.service - - /etc/systemd/system/ceph.target.wants - set_fact: ceph_uid: 64045 @@ -352,6 +367,14 @@ state: stopped enabled: no + - name: remove old systemd unit files + file: + path: /usr/lib/systemd/system/{{ item }} + state: absent + with_items: + - ceph-mds@.service + - ceph-mds.target + - set_fact: ceph_uid: 64045 when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") @@ -405,6 +428,11 @@ state: stopped enabled: no + - name: remove old systemd unit file + file: + path: /usr/lib/systemd/system/ceph-radosgw@.service + state: absent + - set_fact: ceph_uid: 64045 when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") @@ -457,6 +485,14 @@ state: stopped enabled: no + - name: remove old systemd unit files + file: + path: /usr/lib/systemd/system/{{ item }} + state: absent + with_items: + - ceph-rbd-mirror@.service + - ceph-rbd-mirror.target + - set_fact: ceph_uid: 64045 when: ceph_docker_image_tag | string is match("latest") or ceph_docker_image_tag | string is search("ubuntu") -- 2.39.5