homelab/roles/caddy/tasks/main.yml

36 lines
697 B
YAML
Raw Normal View History

2023-12-24 20:52:13 +01:00
---
2022-12-02 21:23:33 +01:00
- name: Add Caddy GPG key
apt_key:
url: "https://dl.cloudsmith.io/public/caddy/stable/gpg.key"
state: present
- name: Add Caddy repositories
apt_repository:
repo: "{{ item }} https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main"
filename: 'caddy-stable'
state: present
with_items:
- deb
- deb-src
- name: Install Caddy
apt:
name: caddy
state: present
2023-12-24 20:52:13 +01:00
- name: Copy over Caddyfile
copy:
src: Caddyfile
dest: '/etc/caddy/Caddyfile'
owner: root
group: root
mode: '644'
2023-12-30 11:25:58 +01:00
notify: caddy-reload
2023-12-24 20:52:13 +01:00
- name: Ensure Caddy service is running & enabled
service:
name: caddy
state: started
enabled: true