Files
ansible-borgmatic/tasks/uninstall.yaml
2025-10-12 15:58:09 +01:00

34 lines
765 B
YAML

---
- name: Disable borgmatic.timer if installed
ansible.builtin.systemd:
name: borgmatic.timer
enabled: false
masked: true
state: stopped
- name: Remove borgmatic systemd units
ansible.builtin.file:
path: "/etc/systemd/system/{{ item }}"
state: absent
loop:
- borgmatic.service
- borgmatic.timer
when:
- borgmatic_install_from_pip | default(false)
notify: reload systemd
- name: Uninstall borgmatic package
ansible.builtin.package:
name: borgmatic
state: absent
- name: Remove borgmatic configuration directory
ansible.builtin.file:
path: "/etc/borgmatic"
state: absent
- name: Remove borgmatic files in the root user home
ansible.builtin.file:
path: "/root/.borgmatic"
state: absent