Skip to content
Snippets Groups Projects
Commit 2f213d48 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

caddy: Separate site config templating task in its own file

This way, it can be easily included by other roles in order to provide Caddy
configuration.
parent 54b41c83
No related branches found
No related tags found
No related merge requests found
Pipeline #6460 failed
...@@ -36,21 +36,13 @@ ...@@ -36,21 +36,13 @@
- caddy - caddy
- name: Configure Caddy site drop-ins - name: Configure Caddy site drop-ins
ansible.builtin.template: ansible.builtin.include_tasks: site.yml
src: site.j2
dest: /etc/caddy/sites-available/{{ item.key | urlencode }}
validate: caddy validate --adapter caddyfile --config %s
owner: root
group: root
mode: "0644"
loop: "{{ caddy_local_sites | dict2items }}" loop: "{{ caddy_local_sites | dict2items }}"
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
vars: vars:
site_name: "{{ item.key }}" site_name: "{{ item.key }}"
site_config: "{{ item.value }}" site_config: "{{ item.value }}"
notify:
- Reload Caddy
tags: tags:
- caddy - caddy
- config - config
......
---
- name: Configure Caddy site drop-in {{ site_name }}
ansible.builtin.template:
src: site.j2
dest: /etc/caddy/sites-available/{{ site_name | urlencode }}
validate: caddy validate --adapter caddyfile --config %s
owner: root
group: root
mode: "0644"
notify:
- Reload Caddy
tags:
- caddy
- config
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment