This repository has been archived on 2024-11-01. You can view files and clone it, but cannot push or open issues or pull requests.
services/_ansible/roles/caddy/tasks/reload-caddy.yml

16 lines
579 B
YAML

- 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