Files
computer-playbook/roles/web-app-desktop/tasks/01_core.yml
Kevin Veen-Birkenbach 716ebef33b Refactor task includes and update variable handling for Ansible 2.20 migration
This commit updates multiple roles to ensure compatibility with Ansible 2.20.
Several include paths and task-loading mechanisms required adjustments,
as Ansible 2.20 applies stricter evaluation rules for complex Jinja expressions
and no longer resolves certain relative include paths the way Ansible 2.18 did.

Key changes:
- Replaced legacy once_finalize.yml and once_flag.yml with the new structure
  under tasks/utils/once/finalize.yml and tasks/utils/once/flag.yml.
- Updated all include_tasks statements to use 'path_join' with playbook_dir,
  ensuring deterministic and absolute file resolution across roles.
- Fixed all network helper includes by converting direct relative paths such as
  'roles/docker-compose/tasks/utils/network.yml' to proper Jinja-evaluated paths.
- Normalized MATOMO_* variable names for consistency with the updated variable
  scope behavior in Ansible 2.20.
- Removed deprecated patterns that were implicitly supported in Ansible 2.18
  but break under the more strict variable and path resolution model in 2.20.

These changes are part of the full migration step required to ensure the
infinito-nexus roles remain stable, deterministic, and forward-compatible with
Ansible 2.20.

Details of the discussion and reasoning can be found in this conversation:
https://chatgpt.com/share/69300a8d-24d4-800f-bec0-e895a695618a
2025-12-03 11:02:34 +01:00

76 lines
2.2 KiB
YAML

- name: "Load brand logos role for '{{ application_id }}'"
include_role:
name: web-svc-simpleicons
vars:
flush_handlers: true
when:
- run_once_web_svc_simpleicons is not defined
- DESKTOP_SIMPLEICONS_ENABLED | bool
- name: "Validate configuration"
include_tasks: "02_validate.yml"
when: MODE_ASSERT | bool
- name: "Include JS routines"
include_tasks: "03_javascript.yml"
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: sys-stk-full-stateless
vars:
docker_compose_flush_handlers: false
docker_repository_address: "https://github.com/kevinveenbirkenbach/port-ui"
docker_pull_git_repository: true
- name: "Check if host-specific config.yaml exists in {{ DESKTOP_CONFIG_INV_PATH }}"
stat:
path: "{{ DESKTOP_CONFIG_INV_PATH }}"
delegate_to: localhost
become: false
register: config_file
- name: Load menu categories
include_vars:
file: "menu_categories.yml"
- name: Load docker cards
set_fact:
portfolio_cards: "{{ lookup('docker_cards', 'roles') }}"
- name: "Load Desktop Brand logos"
set_fact:
portfolio_cards: "{{ portfolio_cards | add_simpleicon_source(domains, WEB_PROTOCOL) }}"
when: DESKTOP_SIMPLEICONS_ENABLED | bool
changed_when: false
- name: Group docker cards
set_fact:
portfolio_menu_data: "{{ lookup('docker_cards_grouped', portfolio_cards, portfolio_menu_categories) }}"
- name: Copy host-specific config.yaml if it exists
template:
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: "{{ DESKTOP_CONFIG_YML_SRC_FILE }}"
dest: "{{ DESKTOP_CONFIG_YML_DEST }}"
notify: docker compose up
when: not config_file.stat.exists
- name: "Flush docker compose handlers"
meta: flush_handlers
- name: Wait for Desktop HTTP endpoint (required so all logos can be downloaded during initialization)
uri:
url: "http://127.0.0.1:{{ http_port }}/"
status_code: 200
register: desktop_http
retries: 60
delay: 5
until: desktop_http.status == 200
- include_tasks: utils/once/finalize.yml