Optimized for 2.20

This commit is contained in:
2025-12-03 00:32:49 +01:00
parent e9b0760d08
commit 629e6194f9
3 changed files with 21 additions and 11 deletions

View File

@@ -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:

View File

@@ -11,6 +11,6 @@
system_service_timer_enabled: true
when:
- not MODE_RESET | bool
- users['no-reply'].mailu_token | default(false)
- users['no-reply'].mailu_token is defined
- include_tasks: utils/once_finalize.yml

View File

@@ -19,7 +19,7 @@
include_tasks: 04_files.yml
when:
- system_service_copy_files | bool
- system_service_script_src
- system_service_script_src | default('') | length > 0
- name: "Load systemctl logic for '{{ system_service_id }}'"
include_tasks: 05_service.yml