ansible/playbooks/dependencies/caddy.yaml

37 lines
932 B
YAML
Raw Normal View History

2024-10-10 23:30:37 +02:00
---
- name: Setup caddy
2024-10-10 22:25:30 +02:00
hosts: servers
2024-10-10 23:55:47 +02:00
gather_facts: false
2024-10-10 22:25:30 +02:00
become: true
tasks:
2024-10-10 23:30:37 +02:00
- name: Install system deps
ansible.builtin.apt:
2024-10-10 22:25:30 +02:00
pkg:
- debian-keyring
- debian-archive-keyring
- apt-transport-https
- gnupg2
- curl
state: present
- name: Add caddy repository
ansible.builtin.deb822_repository:
name: caddy
2024-10-10 23:30:37 +02:00
uris: https://dl.cloudsmith.io/public/caddy/stable/deb/debian
signed_by: https://dl.cloudsmith.io/public/caddy/stable/gpg.key
components: main
suites: any-version
types: [deb]
2024-10-10 22:25:30 +02:00
state: present
enabled: true
2024-10-10 23:30:37 +02:00
- name: Install caddy
ansible.builtin.apt:
2024-10-10 22:25:30 +02:00
update_cache: true
name: caddy
state: present
2024-10-10 23:30:37 +02:00
notify: Restart caddy
2024-10-10 22:25:30 +02:00
handlers:
2024-10-10 23:30:37 +02:00
- name: Restart caddy
ansible.builtin.service:
2024-10-10 22:25:30 +02:00
name: caddy
state: restarted