Add cron job to prune unused Docker data
This commit is contained in:
parent
f68350a4a9
commit
c1c18a628c
|
@ -8,5 +8,11 @@
|
||||||
mode: u=rw,g=r,o=r
|
mode: u=rw,g=r,o=r
|
||||||
notify: reload-dockerd
|
notify: reload-dockerd
|
||||||
|
|
||||||
- name: Flush handlers
|
- name: Configure cron job to prune unused Docker data weekly
|
||||||
ansible.builtin.meta: flush_handlers
|
ansible.builtin.cron:
|
||||||
|
name: Prune unused Docker data
|
||||||
|
cron_file: ansible_docker_prune
|
||||||
|
job: 'docker system prune -fa && docker volume prune -fa'
|
||||||
|
special_time: weekly
|
||||||
|
user: root
|
||||||
|
state: present
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
- name: Add Docker apt repository
|
- name: Add Docker apt repository
|
||||||
ansible.builtin.apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable
|
repo: 'deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable'
|
||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|
||||||
|
@ -39,6 +39,11 @@
|
||||||
|
|
||||||
- name: Configure Docker
|
- name: Configure Docker
|
||||||
ansible.builtin.import_tasks: config.yml
|
ansible.builtin.import_tasks: config.yml
|
||||||
|
tags:
|
||||||
|
- docker_config
|
||||||
|
|
||||||
|
- name: Flush handlers
|
||||||
|
ansible.builtin.meta: flush_handlers
|
||||||
|
|
||||||
- name: Set up Docker services
|
- name: Set up Docker services
|
||||||
ansible.builtin.import_tasks: services.yml
|
ansible.builtin.import_tasks: services.yml
|
||||||
|
|
Reference in a new issue