evocheck: execute evocheck without --cron the first of the month

This commit is contained in:
Jérémy Dubois 2022-07-12 09:38:00 +02:00
parent 17ac3a3a36
commit 12c8f02884
2 changed files with 24 additions and 4 deletions

View File

@ -27,8 +27,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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
- pf : reorder some rules, more details on some comments
- pf: reorder some rules, more details on some comments
- update of tags for each tasks and ease the update of scripts
- evocheck: execute evocheck without --cron the first of the month
### Fixed

View File

@ -29,11 +29,30 @@
tags:
- evocheck
- name: "Add evocheck cron"
- name: "Delete legacy evocheck cron"
lineinfile:
path: /etc/daily.local
regexp: 'sh /usr/share/scripts/evocheck.sh --verbose --cron'
state: absent
tags:
- evocheck
- name: "Add evocheck cron - test for date"
lineinfile:
path: /etc/daily.local
insertbefore: BOF
line: 'sh /usr/share/scripts/evocheck.sh --verbose --cron'
line: 'if [ $(date +%d) -eq "01" ]; then cron_arg=""; else cron_arg="--cron"; fi'
owner: root
mode: "0644"
create: true
tags:
- evocheck
- name: "Add evocheck cron"
lineinfile:
path: /etc/daily.local
insertafter: 'if [ $(date +%d) -eq "01" ]; then cron_arg=""; else cron_arg="--cron"; fi'
line: 'sh /usr/share/scripts/evocheck.sh --verbose $cron_arg'
owner: root
mode: "0644"
create: true
@ -44,7 +63,7 @@
lineinfile:
path: /etc/daily.local
line: 'next_part "Evocheck output:"'
insertbefore: 'sh /usr/share/scripts/evocheck.sh --verbose --cron'
insertbefore: 'if [ $(date +%d) -eq "01" ]; then cron_arg=""; else cron_arg="--cron"; fi'
owner: root
mode: "0644"
create: true