more things

This commit is contained in:
Uumas
2021-03-21 20:45:41 +02:00
parent 10d835e82c
commit 1a98add866
9 changed files with 209 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
---
- name: Install dependencies
apt:
name:
- debian-keyring
- debian-archive-keyring
- apt-transport-https
update_cache: yes
- name: Add caddy repo signing key
apt_key:
id: '65760C51EDEA2017CEA2CA15155B6D79CA56EA34'
url: 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key'
- name: Add caddy repo
apt_repository:
repo: "deb https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main"
filename: 'caddy-stable'
mode: '644'
- name: Install caddy
apt:
name: caddy
- name: Remove default settings from caddyfile
blockinfile:
path: /etc/caddy/Caddyfile
marker: "{mark}"
marker_begin: ':80'
marker_end: '# https://caddyserver.com/docs/caddyfile'
state: absent
validate: 'caddy validate --config %s --adapter caddyfile'
backup: yes
- name: Put caddy general config in place
blockinfile:
path: /etc/caddy/Caddyfile
marker: "# {mark} ANSIBLE MANAGED BLOCK general"
block: |
{
email {{ email }}
}
validate: 'caddy validate --config %s --adapter caddyfile'
backup: yes
notify: reload caddy