mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-10 19:35:26 +00:00
Optimized for 2.20
This commit is contained in:
@@ -1,17 +1,27 @@
|
||||
- name: "Find optional Dockerfile for {{ application_id }}"
|
||||
set_fact:
|
||||
dockerfile_src: >-
|
||||
{{ lookup(
|
||||
'first_found',
|
||||
{
|
||||
'files': [
|
||||
application_id | abs_role_path_by_application_id ~ '/templates/Dockerfile.j2',
|
||||
application_id | abs_role_path_by_application_id ~ '/files/Dockerfile'
|
||||
]
|
||||
},
|
||||
errors='ignore'
|
||||
) | default('', true)
|
||||
}}
|
||||
|
||||
- name: "Create (optional) Dockerfile for {{ application_id }}"
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
src: "{{ dockerfile_src }}"
|
||||
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:
|
||||
notify:
|
||||
- docker compose build
|
||||
- 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"
|
||||
when:
|
||||
- dockerfile_src | default('') | length > 0
|
||||
|
||||
- name: "Create (optional) '{{ docker_compose.files.env }}'"
|
||||
template:
|
||||
|
||||
Reference in New Issue
Block a user