---
- include_tasks: utils/once/flag.yml
- name: "β
Ensure the full openresty config tree exists before any http-include writer"
directory_batch:
entries: >-
{{ lookup('nginx','directories.ensure') + [
{'path': lookup('nginx','directories.data.well_known'), 'mode': '0755'},
{'path': LETSENCRYPT_WEBROOT_PATH, 'mode': '0755'},
{'path': LETSENCRYPT_BASE_PATH, 'mode': '0755'},
{'path': TLS_SELFSIGNED_BASE_PATH, 'mode': '0755'},
] }}
- name: π Stat the nginx.conf path
ansible.builtin.stat:
path: "{{ lookup('nginx','files.configuration') }}"
register: _openresty_conf_stat
- name: ποΈ Drop nginx.conf if a bind-mount created it as a directory
ansible.builtin.file:
path: "{{ lookup('nginx','files.configuration') }}"
state: absent
when: _openresty_conf_stat.stat.exists and _openresty_conf_stat.stat.isdir
- name: β
Ensure base nginx.conf exists (bootstrap)
ansible.builtin.copy:
dest: "{{ lookup('nginx','files.configuration') }}"
force: false
mode: "0644"
content: |
events {}
http { server { listen 8080; return 200; } }
- name: "π§ Setup container network for {{ application_id }}"
include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/network/routine.yml') }}"
vars:
compose_handlers_flush: true
- name: "β
Verify that '{{ role_name }}' works"
include_tasks: 01_assert.yml
when: MODE_ASSERT_LOCAL | bool
- include_tasks: utils/once/flag.yml