Great docker refactoring

This commit is contained in:
2025-07-06 18:53:45 +02:00
parent bd9e43506f
commit 0347d238c2
27 changed files with 107 additions and 119 deletions

View File

@@ -1,10 +1,10 @@
- name: Create (optional) Dockerfile
- name: "Create (optional) Dockerfile for {{ application_id }}"
template:
src: "{{ item }}"
dest: "{{ docker_compose.files.dockerfile }}"
with_first_found:
- "{{ playbook_dir }}/roles/{{ role_name }}/templates/Dockerfile.j2"
- "{{ playbook_dir }}/roles/{{ role_name }}/files/Dockerfile"
loop:
- "{{ playbook_dir }}/roles/docker-{{ application_id }}/templates/Dockerfile.j2"
- "{{ playbook_dir }}/roles/docker-{{ application_id }}/files/Dockerfile"
notify: docker compose up
register: create_dockerfile_result
failed_when:
@@ -19,9 +19,9 @@
force: yes
notify: docker compose up
register: env_template
with_first_found:
- "{{ playbook_dir }}/roles/{{ role_name }}/templates/env.j2"
- "{{ playbook_dir }}/roles/{{ role_name }}/files/env"
loop:
- "{{ playbook_dir }}/roles/docker-{{ application_id }}/templates/env.j2"
- "{{ playbook_dir }}/roles/docker-{{ application_id }}/files/env"
failed_when:
- env_template is failed
- "'Could not find or access' not in env_template.msg"

View File

@@ -16,5 +16,8 @@
mode: '0755'
with_dict: "{{ docker_compose.directories }}"
- include_tasks: "create-files.yml"
- include_tasks: "repository.yml"
when: docker_repository | bool
- include_tasks: "files.yml"
when: not docker_compose_skipp_file_creation | bool

View File

@@ -0,0 +1,13 @@
- name: Set default docker_repository_path
set_fact:
docker_repository_path: "{{docker_compose.directories.services}}repository/"
- name: pull docker repository
git:
repo: "{{ docker_repository_address }}"
dest: "{{ docker_repository_path }}"
update: yes
notify:
- docker compose up
- rebuild docker repository
become: true