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/tasks/steps/template-site-config.yml

18 lines
619 B
YAML
Raw Normal View History

- name: Template caddy site
2023-06-13 20:36:13 +00:00
ansible.builtin.template:
src: caddy_site.conf.j2
dest: "{{ (caddy_config_path, svc.domain + '.conf') | path_join }}"
mode: "0644"
2023-12-04 20:36:32 +00:00
register: template_result
- name: Register caddy site
ansible.builtin.set_fact:
managed_sites: "{{ managed_sites + [svc.domain + '.conf'] }}"
2023-12-04 15:47:00 +00:00
- 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 }}"
2023-12-10 22:49:02 +00:00
when: "'local-dev' != inventory_hostname"
2023-12-04 20:36:32 +00:00
changed_when: template_result.changed