refactored to timer routine

This commit is contained in:
2024-01-04 13:27:07 +01:00
parent 973e667b4f
commit 40f6f7dc4f
43 changed files with 152 additions and 335 deletions

View File

@@ -16,13 +16,16 @@
notify: reload health-docker-volumes.service
when: run_once_health_docker_volumes is not defined
- name: create health-docker-volumes.timer
template:
src: health-docker-volumes.timer.j2
dest: "/etc/systemd/system/health-docker-volumes.timer"
register: health_docker_volumes_timer
changed_when: health_docker_volumes_timer.changed or activate_all_timers | bool
notify: restart health-docker-volumes.timer
- name: set service_name to the name of the current role
set_fact:
service_name: "{{ role_name }}"
when: run_once_health_docker_volumes is not defined
- name: "include role for systemd-timer for {{service_name}}"
include_role:
name: systemd-timer
vars:
on_calendar: "{{on_calendar_health_docker_volumes}}"
when: run_once_health_docker_volumes is not defined
- name: run the health_docker_volumes tasks once