16 lines
575 B
YAML
16 lines
575 B
YAML
- name: Template caddy site
|
|
ansible.builtin.template:
|
|
src: caddy_site.conf.j2
|
|
dest: "{{ (caddy_config_path, svc.domain + '.conf') | path_join }}"
|
|
mode: "0644"
|
|
register: template_result
|
|
|
|
- name: Register caddy site
|
|
ansible.builtin.set_fact:
|
|
managed_sites: "{{ managed_sites + [svc.domain + '.conf'] }}"
|
|
|
|
- name: Reload caddy
|
|
ansible.builtin.command:
|
|
cmd: docker compose exec app sh -c "caddy validate --config /etc/caddy/Caddyfile && caddy reload --config /etc/caddy/Caddyfile"
|
|
chdir: "{{ caddy_path }}"
|
|
changed_when: template_result.changed
|