[BREAKING] Caddy: Upgrade to caddyserver v2
See https://caddyserver.com/docs/v2-upgrade for changes on the Caddyfile
This commit is contained in:
parent
db0db4ddb7
commit
480db3d6fb
5 changed files with 25 additions and 42 deletions
|
@ -21,19 +21,31 @@
|
|||
state: directory
|
||||
|
||||
- name: caddyserver - Download caddy webserver (amd64)
|
||||
become: yes
|
||||
get_url:
|
||||
url: "https://caddyserver.com/download/linux/amd64?plugins={{ caddy_plugins }}&license=personal"
|
||||
dest: "{{ caddy_cachedir }}/tmp/caddy.tar.gz"
|
||||
url: "https://caddyserver.com/api/download?os=linux&arch=amd64"
|
||||
dest: "{{ caddy_cachedir }}/tmp/caddy"
|
||||
group: root
|
||||
owner: root
|
||||
mode: 0755
|
||||
when: ansible_architecture == "x86_64"
|
||||
- name: caddyserver - Download caddy webserver (armv7/ raspberry pi)
|
||||
become: yes
|
||||
get_url:
|
||||
url: "https://caddyserver.com/download/linux/arm7?plugins={{ caddy_plugins }}&license=personal"
|
||||
dest: "{{ caddy_cachedir }}/tmp/caddy.tar.gz"
|
||||
url: "https://caddyserver.com/api/download?os=linux&arch=arm&arm=7"
|
||||
dest: "{{ caddy_cachedir }}/tmp/caddy"
|
||||
group: root
|
||||
owner: root
|
||||
mode: 0755
|
||||
when: ansible_architecture == "armv7l"
|
||||
- name: caddyserver - Download caddy webserver (arm64)
|
||||
become: yes
|
||||
get_url:
|
||||
url: "https://caddyserver.com/download/linux/arm64?plugins={{ caddy_plugins }}&license=personal"
|
||||
dest: "{{ caddy_cachedir }}/tmp/caddy.tar.gz"
|
||||
url: "https://caddyserver.com/api/download?os=linux&arch=arm64"
|
||||
dest: "{{ caddy_cachedir }}/tmp/caddy"
|
||||
group: root
|
||||
owner: root
|
||||
mode: 0755
|
||||
when: ansible_architecture == "aarch64"
|
||||
|
||||
- name: caddyserver - Stop caddy
|
||||
|
@ -43,8 +55,6 @@
|
|||
state: stopped
|
||||
ignore_errors: yes
|
||||
|
||||
- name: caddyserver - Extract caddy
|
||||
shell: "cd {{ caddy_cachedir }}/tmp && tar -xvf caddy.tar.gz"
|
||||
- name: caddyserver - Copy caddy to a PATH location
|
||||
become: yes
|
||||
shell: "cp {{ caddy_cachedir }}/tmp/caddy /usr/local/bin"
|
||||
|
@ -53,16 +63,4 @@
|
|||
file:
|
||||
path: "{{ caddy_cachedir }}/tmp"
|
||||
state: absent
|
||||
- name: caddyserver - Install caddy APT dependencies
|
||||
become: yes
|
||||
apt:
|
||||
name: libcap2-bin
|
||||
state: present
|
||||
- name: caddyserver - Give caddy port binding capabilities
|
||||
become: yes
|
||||
shell: "setcap cap_net_bind_service=+ep /usr/local/bin/caddy"
|
||||
# capabilities:
|
||||
# path: "{{ caddy_bin }}"
|
||||
# capability: cap_net_bind_service+ep
|
||||
# state: present
|
||||
when: caddy_releases_cache.changed
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
group: www-data
|
||||
mode: 0770
|
||||
with_items:
|
||||
- /etc/ssl/caddy
|
||||
- /var/lib/caddy
|
||||
- /etc/caddy
|
||||
- name: caddyserver - Add Caddy home directory
|
||||
become: yes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue