From 378111d52965c34994fbd6bdcdd4f403aeabf90f Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 6 Sep 2020 16:31:48 +0200 Subject: [PATCH] updated schedules in pkg state --- states/pkg/tasks.sls | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/states/pkg/tasks.sls b/states/pkg/tasks.sls index 1108529..ed3708c 100644 --- a/states/pkg/tasks.sls +++ b/states/pkg/tasks.sls @@ -1,8 +1,20 @@ --- -pkg-clean-task: - cron.present: +pkg-clean-task-cron: + cron.absent: - name: apt-get clean - user: root - - minute: {{ range(1, 59) | random }} - - hour: {{ range(1, 23) | random }} - - identifier: pkg-clean-task \ No newline at end of file + - identifier: pkg-clean-task + +pkg-update-task-schedule: + schedule.present: + - name: pkg-update-task-schedule + - function: pkg.refresh_db + - minutes: 24 + +pkg-clean-task-schedule: + schedule.present: + - name: pkg-clean-task-schedule + - function: cmd.run + - job_args: apt-get clean + - minutes: 12 + - hours: 12