2023-08-07 22:28:37 +02:00
|
|
|
- name: install lsof and python-psutil
|
2023-04-25 22:33:04 +02:00
|
|
|
community.general.pacman:
|
|
|
|
name:
|
|
|
|
- lsof
|
2023-08-07 22:28:37 +02:00
|
|
|
- python-psutil
|
2023-04-25 22:33:04 +02:00
|
|
|
state: present
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_cleanup_backups_service is not defined
|
2023-04-25 22:33:04 +02:00
|
|
|
|
2023-11-17 12:35:39 +01:00
|
|
|
- name: "create {{docker_cleanup_backups}}"
|
2023-03-26 17:05:06 +02:00
|
|
|
file:
|
2023-11-17 12:35:39 +01:00
|
|
|
path: "{{docker_cleanup_backups}}"
|
2023-03-26 17:05:06 +02:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_cleanup_backups_service is not defined
|
2023-03-26 17:05:06 +02:00
|
|
|
|
2023-11-16 19:43:54 +01:00
|
|
|
- name: create cleanup-backups.py
|
2023-04-16 12:37:31 +02:00
|
|
|
copy:
|
2023-11-16 19:43:54 +01:00
|
|
|
src: "cleanup-backups.py"
|
2023-11-17 12:35:39 +01:00
|
|
|
dest: "{{docker_cleanup_backups}}cleanup-backups.py"
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_cleanup_backups_service is not defined
|
2021-06-19 13:10:59 +02:00
|
|
|
|
2024-01-10 11:18:38 +01:00
|
|
|
- name: create cleanup-backups.cymais.service
|
2023-04-16 13:29:12 +02:00
|
|
|
template:
|
2023-11-16 19:43:54 +01:00
|
|
|
src: "cleanup-backups.service.j2"
|
2024-01-10 11:18:38 +01:00
|
|
|
dest: "/etc/systemd/system/cleanup-backups.cymais.service"
|
|
|
|
notify: reload cleanup-backups.cymais.service
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_cleanup_backups_service is not defined
|
|
|
|
|
|
|
|
- name: run the cleanup_backups_service tasks once
|
|
|
|
set_fact:
|
|
|
|
run_once_cleanup_backups_service: true
|
|
|
|
when: run_once_cleanup_backups_service is not defined
|