From 19926b0c57320d2f19fa4bad14f0cae56c5a5a39 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 29 Aug 2025 11:04:52 +0200 Subject: [PATCH] Optimized web-app-desktop variables --- roles/web-app-desktop/tasks/01_core.yml | 12 ++++++------ roles/web-app-desktop/vars/main.yml | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/roles/web-app-desktop/tasks/01_core.yml b/roles/web-app-desktop/tasks/01_core.yml index 1707571d..e52101c4 100644 --- a/roles/web-app-desktop/tasks/01_core.yml +++ b/roles/web-app-desktop/tasks/01_core.yml @@ -9,9 +9,9 @@ include_role: name: sys-stk-full-stateless -- name: "Check if host-specific config.yaml exists in {{ DESKTOP_INVENTORY_CONFIG_PATH }}" +- name: "Check if host-specific config.yaml exists in {{ DESKTOP_CONFIG_INV_PATH }}" stat: - path: "{{ DESKTOP_INVENTORY_CONFIG_PATH }}" + path: "{{ DESKTOP_CONFIG_INV_PATH }}" delegate_to: localhost become: false register: config_file @@ -45,15 +45,15 @@ - name: Copy host-specific config.yaml if it exists template: - src: "{{ DESKTOP_INVENTORY_CONFIG_PATH }}" - dest: "{{ docker_repository_path }}/app/config.yaml" + src: "{{ DESKTOP_CONFIG_INV_PATH }}" + dest: "{{ DESKTOP_CONFIG_YML_DEST }}" notify: docker compose up when: config_file.stat.exists - name: Copy default config.yaml from the role template if host-specific file does not exist template: - src: "config.yaml.j2" - dest: "{{ docker_repository_path }}/app/config.yaml" + src: "{{ DESKTOP_CONFIG_YML_SRC_FILE }}" + dest: "{{ DESKTOP_CONFIG_YML_DEST }}" notify: docker compose up when: not config_file.stat.exists diff --git a/roles/web-app-desktop/vars/main.yml b/roles/web-app-desktop/vars/main.yml index 095c07bb..1cf267c9 100644 --- a/roles/web-app-desktop/vars/main.yml +++ b/roles/web-app-desktop/vars/main.yml @@ -22,7 +22,9 @@ DESKTOP_LOCATION_SILENT_CHECK: "/silent-check-sso.html" ## Configuration -DESKTOP_INVENTORY_CONFIG_PATH: "{{ inventory_dir }}/files/{{ inventory_hostname }}/docker/web-app-desktop/config.yaml.j2" +DESKTOP_CONFIG_YML_SRC_FILE: "config.yaml.j2" +DESKTOP_CONFIG_INV_PATH: "{{ [ inventory_dir, 'files', inventory_hostname ,'docker',application_id,DESKTOP_CONFIG_YML_SRC_FILE] | path_join }}" +DESKTOP_CONFIG_YML_DEST: "{{ [ docker_repository_path, 'app/config.yaml'] | path_join }}" ## OIDC DESKTOP_KEYCLOAK_LOGIN_URL: >-