Improved performance by executing tasks just once per host

This commit is contained in:
2023-12-12 15:10:11 +01:00
parent e4c380b2b5
commit 1d2f2875b5
29 changed files with 190 additions and 6 deletions

View File

@@ -4,20 +4,29 @@
- lsof
- python-psutil
state: present
when: run_once_cleanup_backups_service is not defined
- name: "create {{docker_cleanup_backups}}"
file:
path: "{{docker_cleanup_backups}}"
state: directory
mode: 0755
when: run_once_cleanup_backups_service is not defined
- name: create cleanup-backups.py
copy:
src: "cleanup-backups.py"
dest: "{{docker_cleanup_backups}}cleanup-backups.py"
when: run_once_cleanup_backups_service is not defined
- name: create cleanup-backups.service
template:
src: "cleanup-backups.service.j2"
dest: "/etc/systemd/system/cleanup-backups.service"
notify: reload cleanup-backups.service
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