54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
---
|
|
- name: Require explicit approval before installing Matrix health checks
|
|
ansible.builtin.assert:
|
|
that:
|
|
- matrix_healthcheck_enabled | bool
|
|
fail_msg: Set matrix_healthcheck_enabled=true only after the Matrix namespace and backup job exist.
|
|
|
|
- name: Create Matrix healthcheck script directory
|
|
ansible.builtin.file:
|
|
path: "{{ matrix_healthcheck_script_path | dirname }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
|
|
- name: Create Matrix healthcheck state directory
|
|
ansible.builtin.file:
|
|
path: "{{ matrix_healthcheck_state_path | dirname }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0750"
|
|
|
|
- name: Install Matrix K3s healthcheck script
|
|
ansible.builtin.template:
|
|
src: matrix-k3s.sh.j2
|
|
dest: "{{ matrix_healthcheck_script_path }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0750"
|
|
|
|
- name: Install Matrix K3s healthcheck systemd service
|
|
ansible.builtin.template:
|
|
src: matrix-k3s.service.j2
|
|
dest: "/etc/systemd/system/{{ matrix_healthcheck_service_name }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
|
|
- name: Install Matrix K3s healthcheck systemd timer
|
|
ansible.builtin.template:
|
|
src: matrix-k3s.timer.j2
|
|
dest: "/etc/systemd/system/{{ matrix_healthcheck_timer_name }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
|
|
- name: Enable Matrix K3s healthcheck timer
|
|
ansible.builtin.systemd:
|
|
name: "{{ matrix_healthcheck_timer_name }}"
|
|
enabled: true
|
|
state: started
|
|
daemon_reload: true
|