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 - hosts: docker_cluster
roles: roles:
- node_explorer # - node_explorer
# - ssh # - ssh
# - docker-cluster - docker-cluster
# - ubuntu # - ubuntu
# #
#- hosts: raspberry #- 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

@ -14,3 +14,5 @@
- import_tasks: docker-watcher.yml - import_tasks: docker-watcher.yml
- import_tasks: ssh-external.yml - import_tasks: ssh-external.yml
- import_tasks: docker-cron.yml