Skip to content
Snippets Groups Projects
Commit 89d3b7ac 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 a584e9ae
No related branches found
No related tags found
1 merge request!52Draft: Add role for Caddy web server
Checking pipeline status
......@@ -36,21 +36,13 @@
- caddy
- name: Configure Caddy site drop-ins
ansible.builtin.template:
src: site.j2
dest: /etc/caddy/sites-available/{{ item.key | urlencode }}
validate: caddy validate --adapter caddyfile --config %s
owner: root
group: root
mode: "0644"
ansible.builtin.include_tasks: site.yml
loop: "{{ caddy_local_sites | dict2items }}"
loop_control:
label: "{{ item.key }}"
vars:
site_name: "{{ item.key }}"
site_config: "{{ item.value }}"
notify:
- Reload Caddy
tags:
- caddy
- 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