You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
887 B
YAML

---
- name: Create Caddyfile
copy:
src: "{{ caddy_config_file }}"
dest: "/etc/caddy/Caddyfile"
owner: "caddy"
mode: 0640
notify:
- Reload caddy
- name: Clear sites.d directory before adding net configurations
file:
path: "{{ caddy_config_sites_directory }}"
owner: "caddy"
group: "caddy"
state: absent
when: caddy_config_sites_paths is defined and caddy_config_sites_clear
- name: Add sites.d directory
file:
path: "{{ caddy_config_sites_directory }}"
owner: "caddy"
group: "caddy"
state: directory
when: caddy_config_sites_paths is defined
- name: Template site configurations
template:
src: "{{ item }}"
dest: "{{ caddy_config_sites_directory }}"
owner: "caddy"
group: "caddy"
with_fileglob: "{{ caddy_config_sites_paths }}"
when: caddy_config_sites_paths is defined
notify:
- Reload caddy