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

44 lines
1.2 KiB
YAML
Raw Normal View History

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
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
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"
when: run_once_health_nginx is not defined
2023-11-17 09:36:40 +01:00
- name: create health-nginx.cymais.service
2023-11-17 09:36:40 +01:00
template:
src: health-nginx.service.j2
dest: /etc/systemd/system/health-nginx.cymais.service
notify: reload health-nginx.cymais.service
when: run_once_health_nginx is not defined
2023-11-17 09:36:40 +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_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
set_fact:
run_once_health_nginx: true
when: run_once_health_nginx is not defined