mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +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:
34
roles/docker-compose/tasks/04_files.yml
Normal file
34
roles/docker-compose/tasks/04_files.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
- name: "Create (optional) Dockerfile for {{ application_id }}"
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ docker_compose.files.dockerfile }}"
|
||||
loop:
|
||||
- "{{ application_id | abs_role_path_by_application_id }}/templates/Dockerfile.j2"
|
||||
- "{{ application_id | abs_role_path_by_application_id }}/files/Dockerfile"
|
||||
notify: docker compose up
|
||||
register: create_dockerfile_result
|
||||
failed_when:
|
||||
- create_dockerfile_result is failed
|
||||
- "'Could not find or access' not in create_dockerfile_result.msg"
|
||||
|
||||
- name: "Create (optional) '{{ docker_compose.files.env }}'"
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ docker_compose.files.env }}"
|
||||
mode: '770'
|
||||
force: yes
|
||||
notify: docker compose up
|
||||
register: env_template
|
||||
loop:
|
||||
- "{{ application_id | abs_role_path_by_application_id }}/templates/env.j2"
|
||||
- "{{ application_id | abs_role_path_by_application_id }}/files/env"
|
||||
failed_when:
|
||||
- env_template is failed
|
||||
- "'Could not find or access' not in env_template.msg"
|
||||
|
||||
- name: "Create (obligatoric) '{{ docker_compose.files.docker_compose }}'"
|
||||
template:
|
||||
src: "docker-compose.yml.j2"
|
||||
dest: "{{ docker_compose.files.docker_compose }}"
|
||||
notify: docker compose up
|
||||
register: docker_compose_template
|
Reference in New Issue
Block a user