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:
32
roles/reverse_proxy/tasks/20_xcaddy_install.yml
Normal file
32
roles/reverse_proxy/tasks/20_xcaddy_install.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Download xCaddy GPG key
|
||||
ansible.builtin.get_url:
|
||||
url: "https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key"
|
||||
dest: /etc/apt/keyrings/caddy-xcaddy.asc
|
||||
mode: "0644"
|
||||
become: true
|
||||
|
||||
- name: Add xCaddy repository to apt sources
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb [signed-by=/etc/apt/keyrings/caddy-xcaddy.asc] https://dl.cloudsmith.io/public/caddy/xcaddy/deb/debian any-version main"
|
||||
state: present
|
||||
update_cache: true
|
||||
become: true
|
||||
|
||||
- name: Update apt cache
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
become: true
|
||||
|
||||
- name: Install xCaddy
|
||||
ansible.builtin.apt:
|
||||
name: xcaddy
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Build Custom Caddy with netcup
|
||||
ansible.builtin.command: xcaddy build --with github.com/caddy-dns/netcup {{ reverse_proxy_caddy_version}}
|
||||
environment:
|
||||
PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin"
|
||||
register: xcaddy_build
|
||||
failed_when: xcaddy_build.rc != 0
|
||||
Reference in New Issue
Block a user