Deploy uptime-kuma
This commit is contained in:
parent
7564911da3
commit
c472411801
9 changed files with 70 additions and 0 deletions
|
@ -4,6 +4,7 @@ traefik_provider_jellyfin: true
|
|||
traefik_provider_homeassistant: true
|
||||
traefik_provider_grafana: true
|
||||
traefik_provider_dokku: true
|
||||
traefik_provider_uptime_kuma: true
|
||||
|
||||
with_fail2ban: true
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
- hosts: forrest
|
||||
roles:
|
||||
- forrest
|
||||
- uptime_kuma
|
||||
- pve_nebula_route
|
||||
- pve_tailscale_route
|
||||
|
||||
|
|
|
@ -2,5 +2,6 @@ traefik_provider_jellyfin: false
|
|||
traefik_provider_homeassistant: false
|
||||
traefik_provider_grafana: false
|
||||
traefik_provider_dokku: false
|
||||
traefik_provider_uptime_kuma: false
|
||||
|
||||
with_fail2ban: false
|
||||
|
|
10
ansible/roles/traefik/files/file-provider-uptime-kuma.yml
Normal file
10
ansible/roles/traefik/files/file-provider-uptime-kuma.yml
Normal 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
|
|
@ -101,6 +101,16 @@
|
|||
when: traefik_provider_dokku
|
||||
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
|
||||
template:
|
||||
src: files/logrotate.conf
|
||||
|
|
18
ansible/roles/uptime_kuma/files/docker-compose.yml
Normal file
18
ansible/roles/uptime_kuma/files/docker-compose.yml
Normal 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
|
4
ansible/roles/uptime_kuma/handlers/main.yml
Normal file
4
ansible/roles/uptime_kuma/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: restart uptime-kuma
|
||||
shell:
|
||||
chdir: /opt/uptime-kuma
|
||||
cmd: "{{ docker_update_command }}"
|
17
ansible/roles/uptime_kuma/tasks/main.yml
Normal file
17
ansible/roles/uptime_kuma/tasks/main.yml
Normal 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
|
|
@ -261,6 +261,14 @@ resource "cloudflare_record" "jakehowardtech_slides" {
|
|||
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" {
|
||||
zone_id = cloudflare_zone.jakehowardtech.id
|
||||
name = "@"
|
||||
|
|
Loading…
Reference in a new issue