You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
791 B
YAML

---
- name: Create caddy user
user:
state: present
name: "caddy"
groups:
- "www-data"
append: true
shell: "/usr/sbin/nologin"
home: "/var/lib/caddy"
comment: "Caddy web server"
system: yes
- name: Download caddy binary
get_url:
url: "{{ caddy_download_url }}"
dest: "/usr/bin/caddy"
owner: "root"
group: "root"
mode: 0755
- name: Create caddy configuration directory
file:
path: "/etc/caddy"
owner: "caddy"
group: "caddy"
state: directory
- name: Template caddy systemd-service
template:
src: "caddy.service.j2"
dest: "/etc/systemd/system/caddy.service"
- name: Enable and start caddy systemd-service
systemd:
name: "caddy.service"
daemon_reload: yes
enabled: yes
state: started