made caddy config modular
parent
c930ccc44a
commit
e6409a0a0e
|
@ -8,9 +8,7 @@
|
||||||
# this machine's public IP, then replace ":80" below with your
|
# this machine's public IP, then replace ":80" below with your
|
||||||
# domain name.
|
# domain name.
|
||||||
|
|
||||||
media.roosens.me {
|
import *.Caddyfile
|
||||||
reverse_proxy localhost:8096
|
|
||||||
}
|
|
||||||
|
|
||||||
# Refer to the Caddy docs for more information:
|
# Refer to the Caddy docs for more information:
|
||||||
# https://caddyserver.com/docs/caddyfile
|
# https://caddyserver.com/docs/caddyfile
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: reload-caddy
|
- name: caddy-reload
|
||||||
service:
|
service:
|
||||||
name: caddy
|
name: caddy
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '644'
|
mode: '644'
|
||||||
notify: reload-caddy
|
notify: caddy-reload
|
||||||
|
|
||||||
- name: Ensure Caddy service is running & enabled
|
- name: Ensure Caddy service is running & enabled
|
||||||
service:
|
service:
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
- name: Install packages
|
- name: Ensure common packages are installed
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
# Needed for handling GPG keys for repositories
|
# Needed for handling GPG keys for repositories
|
||||||
- debian-keyring
|
- debian-keyring
|
||||||
- debian-archive-keyring
|
- debian-archive-keyring
|
||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
|
- ca-certificates
|
||||||
|
- lsb-release
|
||||||
|
- gnupg
|
||||||
|
|
||||||
# Easy to edit files
|
# Easy to edit files
|
||||||
- vim
|
- vim
|
||||||
|
@ -16,9 +19,24 @@
|
||||||
|
|
||||||
# Disk monitoring
|
# Disk monitoring
|
||||||
- smartmontools
|
- smartmontools
|
||||||
|
|
||||||
|
# Periodic tasks
|
||||||
|
- cron
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Install Vim config
|
- name: Ensure cron service is enabled
|
||||||
|
service:
|
||||||
|
name: cron
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
- name: Ensure fail2ban service is enabled
|
||||||
|
service:
|
||||||
|
name: fail2ban
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
- name: Ensure Vim config is present
|
||||||
get_url:
|
get_url:
|
||||||
url: 'https://r8r.be/vim'
|
url: 'https://r8r.be/vim'
|
||||||
dest: '{{ item.dest }}'
|
dest: '{{ item.dest }}'
|
||||||
|
@ -30,9 +48,3 @@
|
||||||
dest: "/home/debian/.vimrc"
|
dest: "/home/debian/.vimrc"
|
||||||
- user: root
|
- user: root
|
||||||
dest: "/root/.vimrc"
|
dest: "/root/.vimrc"
|
||||||
|
|
||||||
- name: Enable fail2ban
|
|
||||||
service:
|
|
||||||
name: fail2ban
|
|
||||||
state: started
|
|
||||||
enabled: true
|
|
||||||
|
|
|
@ -9,15 +9,6 @@
|
||||||
- runc
|
- runc
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Install Docker PPA dependencies.
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- apt-transport-https
|
|
||||||
- ca-certificates
|
|
||||||
- gnupg
|
|
||||||
- lsb-release
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Add Docker GPG key.
|
- name: Add Docker GPG key.
|
||||||
apt_key:
|
apt_key:
|
||||||
url: https://download.docker.com/linux/ubuntu/gpg
|
url: https://download.docker.com/linux/ubuntu/gpg
|
||||||
|
@ -50,4 +41,4 @@
|
||||||
name: Prune the Docker system.
|
name: Prune the Docker system.
|
||||||
hour: 4
|
hour: 4
|
||||||
minute: 0
|
minute: 0
|
||||||
job: docker system prune -f
|
job: docker system prune -af
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
media.roosens.me {
|
||||||
|
reverse_proxy localhost:8096
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- role: caddy
|
|
@ -50,3 +50,11 @@
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
- name: Ensure Jellyfin Caddyfile is present
|
||||||
|
copy:
|
||||||
|
src: 'jellyfin.Caddyfile'
|
||||||
|
dest: '/etc/caddy/jellyfin.Caddyfile'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
notify: caddy-reload
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
- name: smbpasswd-lambroek
|
- name: smbpasswd-lambroek
|
||||||
shell:
|
shell:
|
||||||
cmd: "smbpasswd -sa lambroek"
|
cmd: "smbpasswd -sa lambroek"
|
||||||
stdin: "{{ lambroek_password }}\n{{ lambroek_password }}"
|
stdin: "{{ lambroek_password }}\n{{ lambroek_password }}\n"
|
||||||
|
|
Loading…
Reference in New Issue