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