From 0ddeb20427de3d23017a02a2820f419d5045cf17 Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Fri, 29 Nov 2024 20:34:13 -0500 Subject: [PATCH] Add crontab to clear docker cache daily at 2am Signed-off-by: Jason Cameron --- automation/playbooks/tasks/common.yml | 7 +++++++ automation/playbooks/update.yml | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 automation/playbooks/tasks/common.yml diff --git a/automation/playbooks/tasks/common.yml b/automation/playbooks/tasks/common.yml new file mode 100644 index 0000000..841ac80 --- /dev/null +++ b/automation/playbooks/tasks/common.yml @@ -0,0 +1,7 @@ +- name: Add crontab to clear old docker cache + ansible.builtin.cron: + name: clear docker cache + minute: 0 + hour: 2 + job: docker system prune -f + user: root diff --git a/automation/playbooks/update.yml b/automation/playbooks/update.yml index 58390ad..bc2449b 100644 --- a/automation/playbooks/update.yml +++ b/automation/playbooks/update.yml @@ -5,6 +5,8 @@ tasks: - name: Update SSH keys ansible.builtin.include_tasks: "tasks/users.yml" + - name: Run common tasks + ansible.builtin.include_tasks: "tasks/common.yml" - name: Update each WLMOJ repository environment: