Add cleanup docker cron tasks
This commit is contained in:
parent
c884417347
commit
802144ecb6
4
main.yml
4
main.yml
@ -12,9 +12,9 @@
|
||||
|
||||
- hosts: docker_cluster
|
||||
roles:
|
||||
- node_explorer
|
||||
# - node_explorer
|
||||
# - ssh
|
||||
# - docker-cluster
|
||||
- docker-cluster
|
||||
# - ubuntu
|
||||
#
|
||||
#- hosts: raspberry
|
||||
|
17
roles/docker-cluster/tasks/docker-cron.yml
Normal file
17
roles/docker-cluster/tasks/docker-cron.yml
Normal 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"
|
@ -14,3 +14,5 @@
|
||||
- import_tasks: docker-watcher.yml
|
||||
|
||||
- import_tasks: ssh-external.yml
|
||||
|
||||
- import_tasks: docker-cron.yml
|
Loading…
Reference in New Issue
Block a user