29 lines
677 B
YAML

- name: Find all infinito.service units
find:
paths: /etc/systemd/system
patterns: '*.infinito.service'
register: infinito_services
- name: Disable and stop each infinito service
become: true
systemd:
name: "{{ item.path | basename }}"
enabled: no
state: stopped
loop: "{{ infinito_services.files }}"
loop_control:
label: "{{ item.path | basename }}"
- name: Remove all infinito.service files
become: true
file:
path: "{{ item.path }}"
state: absent
loop: "{{ infinito_services.files }}"
loop_control:
label: "{{ item.path | basename }}"
- name: Reload systemd daemon
become: true
command: systemctl daemon-reload