Add cleanup docker cron tasks

This commit is contained in:
Przemek Grondek 2022-05-03 02:08:24 +02:00
parent c884417347
commit 802144ecb6
3 changed files with 22 additions and 3 deletions

View File

@ -12,9 +12,9 @@
- hosts: docker_cluster
roles:
- node_explorer
# - node_explorer
# - ssh
# - docker-cluster
- docker-cluster
# - ubuntu
#
#- hosts: raspberry

View File

@ -0,0 +1,17 @@
- name: Clean docker system
become: yes
ansible.builtin.cron:
user: root
name: "clean docker system"
minute: "0"
hour: "3"
job: "/usr/bin/docker system prune -f"
- name: Clean docker image cache
become: yes
ansible.builtin.cron:
user: root
name: "clean docker system"
minute: "0"
hour: "3"
job: "/usr/bin/docker image prune -a -f"

View File

@ -13,4 +13,6 @@
- import_tasks: docker-watcher.yml
- import_tasks: ssh-external.yml
- import_tasks: ssh-external.yml
- import_tasks: docker-cron.yml