switch2container: remove deb systemd units

When running the switch2container playbook on a Debian based system
then the systemd unit path isn't the same than Red Hat based system.
Because the systemd unit files aren't removed then the new container
systemd unit isn't take in count.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit c1af69a7e7)
pull/5791/head
Dimitri Savineau 2020-09-15 09:46:30 -04:00 committed by Dimitri Savineau
parent fd0b9491b6
commit dac0415d75
1 changed files with 28 additions and 15 deletions

View File

@ -80,11 +80,13 @@
- name: remove old systemd unit files - name: remove old systemd unit files
file: file:
path: /usr/lib/systemd/system/{{ item }} path: "{{ item }}"
state: absent state: absent
with_items: with_items:
- ceph-mon@.service - /usr/lib/systemd/system/ceph-mon@.service
- ceph-mon.target - /usr/lib/systemd/system/ceph-mon.target
- /lib/systemd/system/ceph-mon@.service
- /lib/systemd/system/ceph-mon.target
- import_role: - import_role:
name: ceph-defaults name: ceph-defaults
@ -163,11 +165,13 @@
- name: remove old systemd unit files - name: remove old systemd unit files
file: file:
path: /usr/lib/systemd/system/{{ item }} path: "{{ item }}"
state: absent state: absent
with_items: with_items:
- ceph-mgr@.service - /usr/lib/systemd/system/ceph-mgr@.service
- ceph-mgr.target - /usr/lib/systemd/system/ceph-mgr.target
- /lib/systemd/system/ceph-mgr@.service
- /lib/systemd/system/ceph-mgr.target
- import_role: - import_role:
name: ceph-defaults name: ceph-defaults
@ -251,6 +255,9 @@
- /usr/lib/systemd/system/ceph-osd.target - /usr/lib/systemd/system/ceph-osd.target
- /usr/lib/systemd/system/ceph-osd@.service - /usr/lib/systemd/system/ceph-osd@.service
- /usr/lib/systemd/system/ceph-volume@.service - /usr/lib/systemd/system/ceph-volume@.service
- /lib/systemd/system/ceph-osd.target
- /lib/systemd/system/ceph-osd@.service
- /lib/systemd/system/ceph-volume@.service
- import_role: - import_role:
name: ceph-facts name: ceph-facts
@ -365,11 +372,13 @@
- name: remove old systemd unit files - name: remove old systemd unit files
file: file:
path: /usr/lib/systemd/system/{{ item }} path: "{{ item }}"
state: absent state: absent
with_items: with_items:
- ceph-mds@.service - /usr/lib/systemd/system/ceph-mds@.service
- ceph-mds.target - /usr/lib/systemd/system/ceph-mds.target
- /lib/systemd/system/ceph-mds@.service
- /lib/systemd/system/ceph-mds.target
- import_role: - import_role:
name: ceph-defaults name: ceph-defaults
@ -436,11 +445,13 @@
- name: remove old systemd unit files - name: remove old systemd unit files
file: file:
path: /usr/lib/systemd/system/{{ item }} path: "{{ item }}"
state: absent state: absent
with_items: with_items:
- ceph-radosgw@.service - /usr/lib/systemd/system/ceph-radosgw@.service
- ceph-radosgw.target - /usr/lib/systemd/system/ceph-radosgw.target
- /lib/systemd/system/ceph-radosgw@.service
- /lib/systemd/system/ceph-radosgw.target
- import_role: - import_role:
name: ceph-handler name: ceph-handler
@ -474,11 +485,13 @@
- name: remove old systemd unit files - name: remove old systemd unit files
file: file:
path: /usr/lib/systemd/system/{{ item }} path: "{{ item }}"
state: absent state: absent
with_items: with_items:
- ceph-rbd-mirror@.service - /usr/lib/systemd/system/ceph-rbd-mirror@.service
- ceph-rbd-mirror.target - /usr/lib/systemd/system/ceph-rbd-mirror.target
- /lib/systemd/system/ceph-rbd-mirror@.service
- /lib/systemd/system/ceph-rbd-mirror.target
- import_role: - import_role:
name: ceph-defaults name: ceph-defaults