feat(reverse_proxy): add Netcup DNS ACME challenge support and refactor Caddy setup
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
22
roles/reverse_proxy/tasks/80_configure.yml
Normal file
22
roles/reverse_proxy/tasks/80_configure.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: Ensure Caddy configuration directory exists
|
||||
ansible.builtin.file:
|
||||
path: /etc/caddy
|
||||
state: directory
|
||||
mode: "0755"
|
||||
become: true
|
||||
|
||||
- name: Deploy Caddy configuration file
|
||||
ansible.builtin.template:
|
||||
src: Caddyfile.j2
|
||||
dest: "{{ caddy_config_path }}"
|
||||
mode: "0644"
|
||||
backup: true
|
||||
become: true
|
||||
notify: Restart caddy service
|
||||
|
||||
- name: Format Caddy configuration file
|
||||
ansible.builtin.command:
|
||||
cmd: "caddy fmt --overwrite {{ caddy_config_path }}"
|
||||
become: true
|
||||
notify: Restart caddy service
|
||||
Reference in New Issue
Block a user