mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-12-22 14:01:58 +01:00
36 lines
932 B
YAML
36 lines
932 B
YAML
---
|
|
- name: Setup caddy
|
|
hosts: servers
|
|
gather_facts: false
|
|
become: true
|
|
tasks:
|
|
- name: Install system deps
|
|
ansible.builtin.apt:
|
|
pkg:
|
|
- debian-keyring
|
|
- debian-archive-keyring
|
|
- apt-transport-https
|
|
- gnupg2
|
|
- curl
|
|
state: present
|
|
- name: Add caddy repository
|
|
ansible.builtin.deb822_repository:
|
|
name: caddy
|
|
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]
|
|
state: present
|
|
enabled: true
|
|
- name: Install caddy
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
name: caddy
|
|
state: present
|
|
notify: Restart caddy
|
|
handlers:
|
|
- name: Restart caddy
|
|
ansible.builtin.service:
|
|
name: caddy
|
|
state: restarted
|