mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 23:38:13 +02:00
THE HUGE REFACTORING CALENDER WEEK 33; Optimized Matrix and during this updated variables, and implemented better reset and cleanup mode handling, also solved some initial setup bugs
This commit is contained in:
25
roles/sys-svc-docker/tasks/01_core.yml
Normal file
25
roles/sys-svc-docker/tasks/01_core.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
- name: docker & docker compose install
|
||||
community.general.pacman:
|
||||
name:
|
||||
- 'docker'
|
||||
- 'docker-compose'
|
||||
state: present
|
||||
notify: docker restart
|
||||
|
||||
- name: "Load cleanup tasks when MODE_CLEANUP or MODE_RESET is enabled"
|
||||
include_tasks: "02_cleanup.yml"
|
||||
when: MODE_CLEANUP | bool or MODE_RESET | bool
|
||||
|
||||
- name: "Load reset tasks when MODE_RESET is enabled"
|
||||
include_tasks: "03_reset.yml"
|
||||
when: MODE_RESET | bool
|
||||
|
||||
- name: Include backup, repair and health services for docker
|
||||
include_role:
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- sys-bkp-docker-2-loc
|
||||
- sys-hlth-docker-container
|
||||
- sys-hlth-docker-volumes
|
||||
- sys-rpr-docker-soft
|
||||
- sys-rpr-docker-hard
|
3
roles/sys-svc-docker/tasks/02_cleanup.yml
Normal file
3
roles/sys-svc-docker/tasks/02_cleanup.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
- name: Prune Docker resources
|
||||
become: true
|
||||
ansible.builtin.command: docker system prune -f
|
4
roles/sys-svc-docker/tasks/03_reset.yml
Normal file
4
roles/sys-svc-docker/tasks/03_reset.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: Trigger Docker restart
|
||||
ansible.builtin.debug:
|
||||
msg: "MODE_RESET is enabled → restarting Docker"
|
||||
notify: Restart Docker
|
5
roles/sys-svc-docker/tasks/main.yml
Normal file
5
roles/sys-svc-docker/tasks/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- block:
|
||||
- include_tasks: 01_core.yml
|
||||
- include_tasks: utils/run_once.yml
|
||||
when: run_once_sys_svc_docker is not defined
|
Reference in New Issue
Block a user