- name: Check caddy configuration ansible.builtin.command: cmd: docker compose exec app sh -c "caddy validate --config /etc/caddy/Caddyfile" chdir: "{{ service_path }}" when: "'local-dev' != inventory_hostname" register: cmd_result changed_when: false - name: Reload caddy configuration ansible.builtin.command: cmd: docker compose exec app sh -c "caddy reload --config /etc/caddy/Caddyfile" chdir: "{{ service_path }}" when: - "'local-dev' != inventory_hostname" - cmd_result.rc == 0 changed_when: true # TODO find a way to detect changes