From 1939ca31428e50fa53bf20a5f9fa71887354aae4 Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Wed, 13 Apr 2022 16:22:26 +0200 Subject: [PATCH] renamed install.yml to main.yml and add evocheck cron at the beginning of the daily.local file --- CHANGELOG | 1 + roles/evocheck/tasks/install.yml | 49 ------------------------------- roles/evocheck/tasks/main.yml | 50 +++++++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 roles/evocheck/tasks/install.yml diff --git a/CHANGELOG b/CHANGELOG index 17db088..c323395 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - etc-git: manage commits with an optimized shell script instead of many slow Ansible tasks - etc-git: add versioning for /usr/share/scripts - nagios-nrpe: add a wraper to check_dhcpd to define the number of dhcpd processes that must be running depending on the CARP state +- evocheck: renamed install.yml to main.yml and add evocheck cron at the beginning of the daily.local file ### Fixed diff --git a/roles/evocheck/tasks/install.yml b/roles/evocheck/tasks/install.yml deleted file mode 100644 index d67e430..0000000 --- a/roles/evocheck/tasks/install.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- name: Scripts dir is present - file: - path: "{{ evocheck_bin_dir }}" - state: directory - owner: root - group: wheel - mode: "0700" - tags: - - evocheck - -- name: Copy evocheck.sh - copy: - src: evocheck.sh - dest: "{{ evocheck_bin_dir }}/evocheck.sh" - mode: "0700" - owner: root - force: true - tags: - - evocheck - -- name: Copy evocheck.cf - copy: - src: evocheck.cf - dest: /etc/evocheck.cf - force: false - tags: - - evocheck - -- name: Add evocheck cron - lineinfile: - path: /etc/daily.local - line: 'sh /usr/share/scripts/evocheck.sh --verbose --cron' - owner: root - mode: "0644" - create: true - tags: - - evocheck - -- name: Add evocheck cron next_part - lineinfile: - path: /etc/daily.local - line: 'next_part "Evocheck output:"' - insertbefore: 'sh /usr/share/scripts/evocheck.sh --verbose --cron' - owner: root - mode: "0644" - create: true - tags: - - evocheck diff --git a/roles/evocheck/tasks/main.yml b/roles/evocheck/tasks/main.yml index db69018..1572d6f 100644 --- a/roles/evocheck/tasks/main.yml +++ b/roles/evocheck/tasks/main.yml @@ -1,2 +1,50 @@ --- -- include: install.yml +- name: Scripts dir is present + file: + path: "{{ evocheck_bin_dir }}" + state: directory + owner: root + group: wheel + mode: "0700" + tags: + - evocheck + +- name: Copy evocheck.sh + copy: + src: evocheck.sh + dest: "{{ evocheck_bin_dir }}/evocheck.sh" + mode: "0700" + owner: root + force: true + tags: + - evocheck + +- name: Copy evocheck.cf + copy: + src: evocheck.cf + dest: /etc/evocheck.cf + force: false + tags: + - evocheck + +- name: Add evocheck cron + lineinfile: + path: /etc/daily.local + insertbefore: BOF + line: 'sh /usr/share/scripts/evocheck.sh --verbose --cron' + owner: root + mode: "0644" + create: true + tags: + - evocheck + +- name: Add evocheck cron - next_part + lineinfile: + path: /etc/daily.local + line: 'next_part "Evocheck output:"' + insertbefore: 'sh /usr/share/scripts/evocheck.sh --verbose --cron' + owner: root + mode: "0644" + create: true + tags: + - evocheck