Make docker install more reliable
This commit is contained in:
parent
a9623b63f1
commit
3460fe3302
@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
roles:
|
collections:
|
||||||
- name: community.docker.docker_compose
|
- name: community.docker
|
||||||
|
@ -66,3 +66,12 @@
|
|||||||
name: docker-compose-plugin
|
name: docker-compose-plugin
|
||||||
state: latest
|
state: latest
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|
||||||
|
- name: Create daily Docker system prune cron job
|
||||||
|
ansible.builtin.cron:
|
||||||
|
name: "Daily Docker system prune"
|
||||||
|
minute: "0"
|
||||||
|
hour: "3"
|
||||||
|
job: "docker system prune -f --all"
|
||||||
|
user: root
|
||||||
|
state: present
|
||||||
|
@ -1,4 +1,15 @@
|
|||||||
---
|
---
|
||||||
|
- name: Prune Docker system before starting services
|
||||||
|
ansible.builtin.command: docker system prune -f --all
|
||||||
|
register: prune_output
|
||||||
|
ignore_errors: yes
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Debug - Show Docker prune output
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: prune_output
|
||||||
|
verbosity: 1
|
||||||
|
|
||||||
- name: Ensure services destination directory exists
|
- name: Ensure services destination directory exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ server_services_dir }}"
|
path: "{{ server_services_dir }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user