Added checkcsp to health-csp

This commit is contained in:
2025-05-13 15:43:17 +02:00
parent 894e31bc3f
commit 3cb4cbf0d2
6 changed files with 22 additions and 46 deletions

View File

@@ -1,46 +1,44 @@
- name: "pkgmgr install"
include_role:
name: pkgmgr-install
vars:
package_name: checkcsp
when: run_once_backup_docker_to_local is not defined
- name: "create {{ health_csp_crawler_folder }}"
file:
path: "{{ health_csp_crawler_folder }}"
state: directory
mode: 0755
- 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
when: run_once_backup_docker_to_local is not defined
- 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
when: run_once_backup_docker_to_local is not defined
- 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
when: run_once_backup_docker_to_local is not defined
- name: set service_name to role_name
set_fact:
service_name: "{{ role_name }}"
when: run_once_backup_docker_to_local is not defined
- name: include systemd timer role
include_role:
name: systemd-timer
vars:
on_calendar: "{{ on_calendar_health_csp_crawler }}"
when: run_once_backup_docker_to_local is not defined
- name: run the backup_docker_to_local tasks once
set_fact:
run_once_backup_docker_to_local: true
when: run_once_backup_docker_to_local is not defined