Customize root crontab and daily.local
continuous-integration/drone/push Build is failing Details

Add custome PATH to root crontab
Add environment variable to daily.local
Add a "next_part" before the evocheck line in daily.local
This commit is contained in:
Jérémy Dubois 2020-10-09 14:15:46 +02:00
parent fe0c7f6add
commit c9d1bff1c6
4 changed files with 30 additions and 0 deletions

View File

@ -33,3 +33,5 @@ evomaintenance_hosts: >
{{ evomaintenance_default_hosts
| union(evomaintenance_additional_hosts)
| unique }}
cron_root_path: "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"

19
roles/base/tasks/cron.yml Normal file
View File

@ -0,0 +1,19 @@
---
- name: Customize PATH variable of root crontab
cron:
name: PATH
env: true
value: "{{ cron_root_path }}"
tags:
- cron
- name: Customize daily.local environment
lineinfile:
path: /etc/daily.local
line: 'VERBOSESTATUS=0'
insertbefore: BOF
owner: root
mode: "0644"
create: true
tags:
- cron

View File

@ -8,3 +8,4 @@
- include: sudo.yml
- include: evobackup.yml
- include: newsyslog.yml
- include: cron.yml

View File

@ -36,3 +36,11 @@
create: true
tags:
- evocheck
- name: Add evocheck cron
lineinfile:
path: /etc/daily.local
line: 'next_part "Evocheck output:"'
insertbefore: 'sh /usr/share/scripts/evocheck.sh --verbose --cron'
tags:
- evocheck