[FIX] caddy: support raspbian

This commit is contained in:
Jannik Beyerstedt 2019-10-27 16:26:22 +01:00
parent 92e056e341
commit d49c15f4ef

View file

@ -1,6 +1,12 @@
---
# Server/Caddyserver-Install: Install/Update Caddy Webserver (with some modules)
# Detect some more host facts
- name: caddyserver - Detect debian distributor ID
shell: lsb_release -is
register: lsb_id
- name: caddyserver - Stop caddy
become: yes
service:
@ -11,16 +17,20 @@
file:
path: /tmp/caddy
state: directory
- name: caddyserver - Download caddy webserver
- name: caddyserver - Download caddy webserver (amd64)
get_url:
url: https://caddyserver.com/download/linux/amd64?plugins=http.ratelimit&license=personal
url: "https://caddyserver.com/download/linux/amd64?plugins=http.ratelimit&license=personal"
dest: /tmp/caddy/caddy.tar.gz
when: lsb_id.stdout != "Raspbian"
- name: caddyserver - Download caddy webserver (raspberry pi)
get_url:
url: "https://caddyserver.com/download/linux/arm7?plugins=http.ratelimit&license=personal"
dest: /tmp/caddy/caddy.tar.gz
when: lsb_id.stdout == "Raspbian"
- name: caddyserver - Extract caddy
shell: "cd /tmp/caddy && tar -xvf caddy.tar.gz"
# unarchive:
# src: /tmp/caddy/caddy.tar.gz
# dest: /tmp/caddy
# copy: no
- name: caddyserver - Copy caddy to a PATH location
become: yes
shell: "cp /tmp/caddy/caddy /usr/local/bin"