Provision uptime-kuma

This commit is contained in:
Jake Howard 2021-07-31 16:30:33 +01:00
parent 1399529a47
commit f3bc72d2ba
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 44 additions and 0 deletions

View file

@ -88,6 +88,7 @@
- plausible - plausible
- pages - pages
- restic - restic
- uptime_kuma
- hosts: jellyfin - hosts: jellyfin
roles: roles:

View file

@ -0,0 +1,14 @@
version: "2.3"
services:
uptime-kuma:
image: louislam/uptime-kuma:1
restart: unless-stopped
user: "{{ docker_user.id }}:{{ docker_user.id }}"
volumes:
- ./data:/app/data
labels:
- traefik.enable=true
- traefik.http.routers.uptime-kuma.rule=Host(`uptime.jakehoward.tech`)
- traefik.http.routers.uptime-kuma.tls.certresolver=le
- traefik.http.routers.uptime-kuma.middlewares=compress@file

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

@ -147,3 +147,11 @@ resource "cloudflare_record" "jakehowardtech_vaultwarden" {
type = "A" type = "A"
ttl = 1 ttl = 1
} }
resource "cloudflare_record" "jakehowardtech_uptime" {
zone_id = cloudflare_zone.jakehowardtech.id
name = "uptime"
value = vultr_instance.walker.main_ip
type = "A"
ttl = 1
}