mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-03 07:59:42 +00:00
Unify reverse proxy handling across apps via sys-stk-front-proxy and cleanly separate internal docker nginx configs from external vhosts. Changes: - docker-compose: use with_first_found for optional env and docker-compose.override files so roles can provide either a template or a static file without noisy 'Could not find or access' failures. - sys-stk-front-proxy: remove front_proxy_domain_conf_src and switch nginx vhost rendering to with_first_found over app-specific proxy.conf.j2 and the generic roles/sys-svc-proxy vhost flavour; keep health-check and handler logic unchanged. - web-app-nextcloud: migrate to sys-stk-full-stateful (front proxy + DB + docker), move internal nginx config to docker.conf.j2 under the volume path, and rename host.conf.j2 to proxy.conf.j2 for the external vhost. - web-app-magento: rename nginx.conf.j2 to docker.conf.j2 and update the runtime template task accordingly to make the intent (internal nginx) explicit. - web-app-matrix: rename nginx.conf.j2 to synapse.conf.j2 and adjust the webserver task to use the new template name for the synapse vhost. - web-app-bridgy-fed & web-app-flowise: pass domain and http_port explicitly when including sys-stk-front-proxy so the front stack has all required context. - web-svc-cdn/file/html: replace direct sys-stk-front-base + sys-util-csp-cert + nginx.conf.j2 handling with sys-stk-front-proxy and proxy.conf.j2, relying on the shared front-stack for TLS/CSP/vHost wiring. - web-svc-collabora: drop the direct nginx.conf.j2 vhost generation and rename it to proxy.conf.j2 so it is picked up by sys-stk-front-proxy like other services. - web-opt-rdr-domains: rename redirect.domain.nginx.conf.j2 to redirect-domain.conf.j2 and adjust the task for clearer and more consistent naming. Context: see ChatGPT refactor discussion on 2025-11-30 (proxy unification, Collabora/Nextcloud/CDN stacks, CSP/header handling): https://chatgpt.com/share/692c64ea-a488-800f-ad42-7f7692a3742f
36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
---
|
|
- name: Assert required vars (no defaults anywhere)
|
|
assert:
|
|
that:
|
|
- MAGENTO_DOMAIN is defined and MAGENTO_DOMAIN | length > 0
|
|
- MAGENTO_NGINX_PORT is defined
|
|
- MAGENTO_PHP_HOST is defined and MAGENTO_PHP_HOST | length > 0
|
|
- MAGENTO_PHP_PORT is defined
|
|
- docker_compose.directories.config is defined and docker_compose.directories.config | length > 0
|
|
fail_msg: "Missing one of: MAGENTO_DOMAIN, MAGENTO_NGINX_PORT, MAGENTO_PHP_HOST, MAGENTO_PHP_PORT, docker_compose.directories.config"
|
|
|
|
- name: Ensure subdirs exist (config root exists already)
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: '0755'
|
|
loop:
|
|
- "{{ MAGENTO_NGINX_DIR }}"
|
|
- "{{ MAGENTO_PHP_DIR }}"
|
|
|
|
- name: Render nginx main config (no TLS; single source of truth)
|
|
template:
|
|
src: "docker.conf.j2"
|
|
dest: "{{ MAGENTO_NGINX_CONF_PATH }}"
|
|
mode: '0644'
|
|
force: true
|
|
notify: docker compose up
|
|
|
|
- name: Render php-fpm pool override (TCP listen; clear_env=no)
|
|
template:
|
|
src: "php-fpm-zz-docker.conf.j2"
|
|
dest: "{{ MAGENTO_PHP_ZZ_CONF_PATH }}"
|
|
mode: '0644'
|
|
force: true
|
|
notify: docker compose up
|