mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Added draft for CSP health checker
This commit is contained in:
46
roles/health-csp/tasks/main.yml
Normal file
46
roles/health-csp/tasks/main.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
- name: "Install puppeteer if node_modules not yet present"
|
||||
ansible.builtin.command:
|
||||
cmd: npm install puppeteer
|
||||
chdir: "{{ health_csp_crawler_folder }}"
|
||||
creates: "{{ health_csp_crawler_folder }}/node_modules"
|
||||
|
||||
- name: Check if puppeteer is usable
|
||||
command: node -e "require('puppeteer')"
|
||||
args:
|
||||
chdir: "{{ health_csp_crawler_folder }}"
|
||||
register: puppeteer_check
|
||||
failed_when: puppeteer_check.rc != 0
|
||||
|
||||
- name: "create {{ health_csp_crawler_folder }}"
|
||||
file:
|
||||
path: "{{ health_csp_crawler_folder }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: copy health_csp.py
|
||||
copy:
|
||||
src: health_csp.py
|
||||
dest: "{{ health_csp_crawler_script }}"
|
||||
mode: 0755
|
||||
|
||||
- name: copy health-csp.js
|
||||
copy:
|
||||
src: health-csp.js
|
||||
dest: "{{ health_csp_crawler_node }}"
|
||||
mode: 0755
|
||||
|
||||
- name: create health-csp.cymais.service
|
||||
template:
|
||||
src: health-csp.service.j2
|
||||
dest: /etc/systemd/system/health-csp.cymais.service
|
||||
notify: reload health-csp.cymais.service
|
||||
|
||||
- name: set service_name to role_name
|
||||
set_fact:
|
||||
service_name: "{{ role_name }}"
|
||||
|
||||
- name: include systemd timer role
|
||||
include_role:
|
||||
name: systemd-timer
|
||||
vars:
|
||||
on_calendar: "{{ on_calendar_health_csp_crawler }}"
|
Reference in New Issue
Block a user