2023-11-17 09:36:40 +01:00
|
|
|
- name: Install required Python modules
|
2023-11-17 10:07:20 +01:00
|
|
|
pacman:
|
|
|
|
name: python-requests
|
|
|
|
state: present
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_health_nginx is not defined
|
2023-11-17 09:36:40 +01:00
|
|
|
|
2023-11-17 12:35:39 +01:00
|
|
|
- name: "create {{ health_nginx_folder }}"
|
2023-11-17 09:36:40 +01:00
|
|
|
file:
|
2023-11-17 12:35:39 +01:00
|
|
|
path: "{{ health_nginx_folder }}"
|
2023-11-17 09:36:40 +01:00
|
|
|
state: directory
|
|
|
|
mode: 0755
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_health_nginx is not defined
|
2023-11-17 09:36:40 +01:00
|
|
|
|
|
|
|
- name: create health-nginx.py
|
2023-12-12 15:21:02 +01:00
|
|
|
template:
|
|
|
|
src: health-nginx.py.j2
|
2023-11-17 12:35:39 +01:00
|
|
|
dest: "{{ health_nginx_folder }}health-nginx.py"
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_health_nginx is not defined
|
2023-11-17 09:36:40 +01:00
|
|
|
|
|
|
|
- name: create health-nginx.service
|
|
|
|
template:
|
|
|
|
src: health-nginx.service.j2
|
|
|
|
dest: /etc/systemd/system/health-nginx.service
|
|
|
|
notify: reload health-nginx.service
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_health_nginx is not defined
|
2023-11-17 09:36:40 +01:00
|
|
|
|
|
|
|
- name: create health-nginx.timer
|
|
|
|
template:
|
|
|
|
src: health-nginx.timer.j2
|
|
|
|
dest: "/etc/systemd/system/health-nginx.timer"
|
|
|
|
register: health_nginx_timer
|
2023-12-15 13:27:23 +01:00
|
|
|
changed_when: health_nginx_timer.changed or activate_all_timers | bool
|
2023-11-17 09:36:40 +01:00
|
|
|
notify: restart health-nginx.timer
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_health_nginx is not defined
|
|
|
|
|
|
|
|
- name: run the health_nginx tasks once
|
|
|
|
set_fact:
|
|
|
|
run_once_health_nginx: true
|
|
|
|
when: run_once_health_nginx is not defined
|
|
|
|
|