mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-08 11:17:17 +02:00
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: "nginx.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
|