thingies
This commit is contained in:
parent
5f06a966aa
commit
3343de2dc0
12 changed files with 286 additions and 57 deletions
61
ansible/services/caddy_playbook.yml
Normal file
61
ansible/services/caddy_playbook.yml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
- name: Install and configure Caddy on Debian 12
|
||||
hosts: vipy
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Install required packages
|
||||
apt:
|
||||
name:
|
||||
- debian-keyring
|
||||
- debian-archive-keyring
|
||||
- apt-transport-https
|
||||
- curl
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Download Caddy GPG armored key
|
||||
ansible.builtin.get_url:
|
||||
url: https://dl.cloudsmith.io/public/caddy/stable/gpg.key
|
||||
dest: /tmp/caddy-stable-archive-keyring.asc
|
||||
mode: '0644'
|
||||
|
||||
- name: Convert ASCII armored key to binary keyring
|
||||
ansible.builtin.command:
|
||||
cmd: gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg /tmp/caddy-stable-archive-keyring.asc
|
||||
args:
|
||||
creates: /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||
|
||||
- name: Ensure permissions on keyring file
|
||||
ansible.builtin.file:
|
||||
path: /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Add Caddy repository list file
|
||||
ansible.builtin.get_url:
|
||||
url: https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt
|
||||
dest: /etc/apt/sources.list.d/caddy-stable.list
|
||||
mode: '0644'
|
||||
validate_certs: yes
|
||||
|
||||
- name: Update apt cache after adding repo
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install Caddy
|
||||
apt:
|
||||
name: caddy
|
||||
state: present
|
||||
|
||||
- name: Ensure Caddy service is enabled and started
|
||||
systemd:
|
||||
name: caddy
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Allow HTTPS through UFW
|
||||
ufw:
|
||||
rule: allow
|
||||
port: '443'
|
||||
proto: tcp
|
||||
Loading…
Add table
Add a link
Reference in a new issue