Merge "Move tmpwatch from cron.daily to actual root crontab"

This commit is contained in:
Zuul 2021-03-31 16:09:27 +00:00 committed by Gerrit Code Review
commit 0dbcbd18ad
1 changed files with 30 additions and 15 deletions

View File

@ -104,8 +104,10 @@ outputs:
deploy_steps_tasks:
- name: configure tmpwatch on the host
when: step|int == 2
block:
- name: Push script
copy:
dest: /etc/cron.daily/containers-tmpwatch
dest: /usr/local/sbin/containers-tmpwatch
owner: root
group: root
mode: 0755
@ -119,6 +121,19 @@ outputs:
/var/log/containers/ 2>&1 | logger -t container-tmpwatch
vars:
LogrotatePurgeAfterDays: {get_param: LogrotatePurgeAfterDays}
- name: Insert cronjob in root crontab
cron:
name: "Remove old logs"
special_time: "daily"
user: "root"
job: "/usr/local/sbin/containers-tmpwatch"
update_tasks: &tmpwatch_script_clean
- name: Ensure old cron.daily is absent
when: step|int == 1
file:
path: /etc/cron.daily/containers-tmpwatch
state: absent
upgrade_tasks: *tmpwatch_script_clean
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: crond