--- # Runs in the roles phase, after the register include in pre_tasks created the network. - name: Attach Wiki.js to Postgres ansible.builtin.include_tasks: "{{ playbook_dir }}/../postgres/roles/attach/tasks/main.yaml" # The restart is a handler, so it would run after the wikijs role starts the app. # Flushing applies the new drop-in before the app starts; later runs are a no-op. # Flush also applies Caddy's pending restart, which is right: Caddy must join the network to proxy. - name: Apply the Postgres network change before starting Wiki.js ansible.builtin.meta: flush_handlers