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

@@ -3,15 +3,18 @@
path: "{{health_docker_container_folder}}"
state: directory
mode: 0755
when: run_once_health_docker_container is not defined
- name: create health-docker-container.sh
copy:
src: health-docker-container.sh
dest: "{{health_docker_container_folder}}health-docker-container.sh"
when: run_once_health_docker_container is not defined
- name: create health-docker-container.service
template: src=health-docker-container.service.j2 dest=/etc/systemd/system/health-docker-container.service
notify: reload health-docker-container.service
when: run_once_health_docker_container is not defined
- name: create health-docker-container.timer
template:
@@ -20,3 +23,9 @@
register: health_docker_container_timer
changed_when: health_docker_container_timer.changed or activate_all_timers | default(false) | bool
notify: restart health-docker-container.timer
when: run_once_health_docker_container is not defined
- name: run the health_docker_container tasks once
set_fact:
run_once_health_docker_container: true
when: run_once_health_docker_container is not defined