Refactored docker logic

This commit is contained in:
2025-05-25 17:44:58 +02:00
parent 7a7825cc61
commit cdfd464bce
53 changed files with 95 additions and 146 deletions

1
tasks/.gitignore vendored
View File

@@ -1 +0,0 @@
include-docker-roles.yml

View File

@@ -1,3 +0,0 @@
# todo
- Move update-repository-with-files.yml to own role
- Move copy-docker-compose-and-env.yml to own role

View File

@@ -1,27 +0,0 @@
- name: "create {{ docker_compose.files.docker_compose }}"
template:
src: "docker-compose.yml.j2"
dest: "{{ docker_compose.files.docker_compose }}"
notify: docker compose project setup
register: docker_compose_template
- name: "create {{ docker_compose.files.env }}"
template:
src: "env.j2"
dest: "{{ docker_compose.files.env }}"
mode: '770'
force: yes
notify: docker compose project setup
register: env_template
- name: "Check if any container is running in {{ docker_compose.directories.instance }}"
command: docker compose ps -q --filter status=running
args:
chdir: "{{ docker_compose.directories.instance }}"
register: docker_ps
changed_when: (docker_ps.stdout | trim) == ""
notify: docker compose project setup
when: not (docker_compose_template.changed or env_template.changed)
- name: flush docker compose project setup
meta: flush_handlers

View File

@@ -12,7 +12,7 @@
- system-btrfs-auto-balancer
- name: "Integrate Docker Role includes"
include_tasks: "include-docker-roles.yml"
include_tasks: "./tasks/utils/docker-roles.yml"
# Native Webserver Roles
- name: setup nginx-serve-htmls

1
tasks/utils/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
docker-roles.yml