mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
refactored to timer routine
This commit is contained in:
@@ -3,22 +3,34 @@
|
||||
path: "{{health_journalctl_folder}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
when: run_once_health_journalctl is not defined
|
||||
|
||||
- name: create health-journalctl.sh
|
||||
copy:
|
||||
src: health-journalctl.sh
|
||||
dest: "{{health_journalctl_folder}}health-journalctl.sh"
|
||||
when: run_once_health_journalctl is not defined
|
||||
|
||||
- name: create health-journalctl.service
|
||||
template:
|
||||
src: health-journalctl.service.j2
|
||||
dest: /etc/systemd/system/health-journalctl.service
|
||||
notify: reload health-journalctl.service
|
||||
when: run_once_health_journalctl is not defined
|
||||
|
||||
- name: create health-journalctl.timer
|
||||
template:
|
||||
src: health-journalctl.timer.j2
|
||||
dest: /etc/systemd/system/health-journalctl.timer
|
||||
register: health_journalctl_timer
|
||||
changed_when: health_journalctl_timer.changed or activate_all_timers | bool
|
||||
notify: restart health-journalctl.timer
|
||||
- name: set service_name to the name of the current role
|
||||
set_fact:
|
||||
service_name: "{{ role_name }}"
|
||||
when: run_once_health_journalctl is not defined
|
||||
|
||||
- name: "include role for systemd-timer for {{service_name}}"
|
||||
include_role:
|
||||
name: systemd-timer
|
||||
vars:
|
||||
on_calendar: "{{on_calendar_health_journalctl}}"
|
||||
when: run_once_health_journalctl is not defined
|
||||
|
||||
- name: run the health_journalctl tasks once
|
||||
set_fact:
|
||||
run_once_health_journalctl: true
|
||||
when: run_once_health_journalctl is not defined
|
Reference in New Issue
Block a user