2021-06-16 21:57:28 +02:00
|
|
|
---
|
|
|
|
- name: stop units
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: motd-news
|
|
|
|
masked: yes
|
|
|
|
state: stopped
|
2022-01-15 11:18:44 +01:00
|
|
|
enabled: no
|
2021-06-16 21:57:28 +02:00
|
|
|
notify: systemctl_reset_failed
|
|
|
|
register: scsstop
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: disable units
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.shell: systemctl disable motd-news
|
|
|
|
when: scsstop.changed
|
|
|
|
|
|
|
|
- name: Remove files
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.file:
|
|
|
|
path:
|
|
|
|
- rm /etc/systemd/system/motd-news
|
|
|
|
- rm /usr/lib/systemd/system/motd-news
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: force systemd to reread configs
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
when: scsstop.changed
|
|
|
|
|
|
|
|
|
|
|
|
# https://superuser.com/questions/513159/how-to-remove-systemd-services
|