mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
refactored to timer routine
This commit is contained in:
@@ -3,10 +3,3 @@
|
||||
name: health-nginx.service
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "restart health-nginx.timer"
|
||||
systemd:
|
||||
name: health-nginx.timer
|
||||
state: restarted
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
@@ -24,13 +24,16 @@
|
||||
notify: reload health-nginx.service
|
||||
when: run_once_health_nginx is not defined
|
||||
|
||||
- name: create health-nginx.timer
|
||||
template:
|
||||
src: health-nginx.timer.j2
|
||||
dest: "/etc/systemd/system/health-nginx.timer"
|
||||
register: health_nginx_timer
|
||||
changed_when: health_nginx_timer.changed or activate_all_timers | bool
|
||||
notify: restart health-nginx.timer
|
||||
- name: set service_name to the name of the current role
|
||||
set_fact:
|
||||
service_name: "{{ role_name }}"
|
||||
when: run_once_health_nginx is not defined
|
||||
|
||||
- name: "include role for systemd-timer for {{service_name}}"
|
||||
include_role:
|
||||
name: systemd-timer
|
||||
vars:
|
||||
on_calendar: "{{on_calendar_health_nginx}}"
|
||||
when: run_once_health_nginx is not defined
|
||||
|
||||
- name: run the health_nginx tasks once
|
||||
|
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=starts health-nginx.service
|
||||
|
||||
[Timer]
|
||||
OnCalendar={{ on_calendar_health_nginx }}
|
||||
RandomizedDelaySec={{ randomized_delay_sec }}
|
||||
Persistent=false
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user