Deploy uptime-kuma

This commit is contained in:
Jake Howard 2024-04-21 18:11:39 +01:00
parent 7564911da3
commit c472411801
Signed by: jake
GPG key ID: 57AFB45680EDD477
9 changed files with 70 additions and 0 deletions

View file

@ -4,6 +4,7 @@ traefik_provider_jellyfin: true
traefik_provider_homeassistant: true traefik_provider_homeassistant: true
traefik_provider_grafana: true traefik_provider_grafana: true
traefik_provider_dokku: true traefik_provider_dokku: true
traefik_provider_uptime_kuma: true
with_fail2ban: true with_fail2ban: true

View file

@ -96,6 +96,7 @@
- hosts: forrest - hosts: forrest
roles: roles:
- forrest - forrest
- uptime_kuma
- pve_nebula_route - pve_nebula_route
- pve_tailscale_route - pve_tailscale_route

View file

@ -2,5 +2,6 @@ traefik_provider_jellyfin: false
traefik_provider_homeassistant: false traefik_provider_homeassistant: false
traefik_provider_grafana: false traefik_provider_grafana: false
traefik_provider_dokku: false traefik_provider_dokku: false
traefik_provider_uptime_kuma: false
with_fail2ban: false with_fail2ban: false

View file

@ -0,0 +1,10 @@
http:
routers:
router-uptime-kuma:
rule: Host(`uptime.jakehoward.tech`)
service: service-uptime-kuma
services:
service-uptime-kuma:
loadBalancer:
servers:
- url: http://{{ pve_hosts.forrest.ip }}:3001

View file

@ -101,6 +101,16 @@
when: traefik_provider_dokku when: traefik_provider_dokku
become: true become: true
- name: Install dokku provider
template:
src: files/file-provider-uptime-kuma.yml
dest: /opt/traefik/traefik/conf/uptime-kuma.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
notify: restart traefik
when: traefik_provider_uptime_kuma
become: true
- name: logrotate config - name: logrotate config
template: template:
src: files/logrotate.conf src: files/logrotate.conf

View file

@ -0,0 +1,18 @@
version: "2.3"
services:
uptime-kuma:
image: louislam/uptime-kuma:1.23.11-alpine
environment:
- TZ={{ timezone }}
- PUID={{ docker_user.id }}
- PGID={{ docker_user.id }}
ports:
- "{{ pve_hosts.forrest.ip }}:3001:3001"
volumes:
- "{{ app_data_dir }}/uptime-kuma:/app/data"
restart: unless-stopped
networks:
default:
enable_ipv6: true

View file

@ -0,0 +1,4 @@
- name: restart uptime-kuma
shell:
chdir: /opt/uptime-kuma
cmd: "{{ docker_update_command }}"

View file

@ -0,0 +1,17 @@
- name: Create install directory
file:
path: /opt/uptime-kuma
state: directory
owner: "{{ docker_user.name }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install compose file
template:
src: files/docker-compose.yml
dest: /opt/uptime-kuma/docker-compose.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: docker-compose -f %s config
notify: restart uptime-kuma
become: true

View file

@ -261,6 +261,14 @@ resource "cloudflare_record" "jakehowardtech_slides" {
ttl = 1 ttl = 1
} }
resource "cloudflare_record" "jakehowardtech_uptime" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "uptime"
value = cloudflare_record.sys_domain_pve.hostname
type = "CNAME"
ttl = 1
}
resource "cloudflare_record" "jakehowardtech_caa" { resource "cloudflare_record" "jakehowardtech_caa" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "@" name = "@"