computer-playbook/roles/health-journalctl/tasks/main.yml

36 lines
1.1 KiB
YAML
Raw Normal View History

2023-11-17 12:35:39 +01:00
- name: "create {{health_journalctl_folder}}"
2023-11-16 15:32:29 +01:00
file:
2023-11-17 12:35:39 +01:00
path: "{{health_journalctl_folder}}"
2023-11-16 15:32:29 +01:00
state: directory
mode: 0755
2024-01-04 13:27:07 +01:00
when: run_once_health_journalctl is not defined
2023-11-16 15:32:29 +01:00
- name: create health-journalctl.sh
copy:
src: health-journalctl.sh
2023-11-17 12:35:39 +01:00
dest: "{{health_journalctl_folder}}health-journalctl.sh"
2024-01-04 13:27:07 +01:00
when: run_once_health_journalctl is not defined
2023-11-16 15:32:29 +01:00
- name: create health-journalctl.service
template:
src: health-journalctl.service.j2
dest: /etc/systemd/system/health-journalctl.service
notify: reload health-journalctl.service
2024-01-04 13:27:07 +01:00
when: run_once_health_journalctl is not defined
2023-11-16 15:32:29 +01:00
2024-01-04 13:27:07 +01:00
- 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