Replace uptime kuma with gatus
This commit is contained in:
parent
849b3a277d
commit
9b7b5d3642
9 changed files with 315 additions and 45 deletions
27
roles/gatus/tasks/main.yml
Normal file
27
roles/gatus/tasks/main.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ svc.name }}
|
||||
vars:
|
||||
svc: "{{ gatus_svc }}"
|
||||
yml: "{{ gatus_yml }}"
|
||||
compose: "{{ gatus_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Template config
|
||||
ansible.builtin.template:
|
||||
src: yml.j2
|
||||
dest: "{{ (service_path, 'config.yaml') | path_join }}"
|
||||
mode: "0644"
|
||||
register: cmd_result
|
||||
|
||||
- name: Set the docker force-recreate flag
|
||||
ansible.builtin.set_fact:
|
||||
docker_force_recreate: --force-recreate
|
||||
when: cmd_result.changed # noqa: no-handler We need to handle the restart per service. Handlers don't support variables.
|
||||
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
69
roles/gatus/vars/main.yml
Normal file
69
roles/gatus/vars/main.yml
Normal file
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
gatus_svc:
|
||||
domain: status.serguzim.me
|
||||
name: gatus
|
||||
port: 8080
|
||||
|
||||
gatus_external_endpoints_backups: "{{ vault_hosts | vault_hosts_backup_to_gatus() }}"
|
||||
|
||||
gatus_endpoints_hosts: "{{ opentofu.hosts | hosts_to_gatus() }}"
|
||||
gatus_endpoints_services: "{{ all_services | services_to_gatus() }}"
|
||||
|
||||
gatus_endpoints_other:
|
||||
- name: matrix-federation
|
||||
url: https://federationtester.matrix.org/api/report?server_name=msrg.cc
|
||||
group: 9-external
|
||||
interval: 5m
|
||||
conditions:
|
||||
- '[STATUS] == 200'
|
||||
- '[BODY].FederationOK == true'
|
||||
ui:
|
||||
hide-url: true
|
||||
alerts:
|
||||
- type: ntfy
|
||||
send-on-resolved: true
|
||||
- type: email
|
||||
send-on-resolved: true
|
||||
- name: healthchecks-io
|
||||
url: "{{ opentofu.healthchecksio.status.ping_url }}"
|
||||
group: 9-external
|
||||
interval: 5m
|
||||
conditions:
|
||||
- '[STATUS] == 200'
|
||||
ui:
|
||||
hide-url: true
|
||||
|
||||
gatus_yml:
|
||||
storage:
|
||||
type: sqlite
|
||||
path: /data/data.db
|
||||
|
||||
connectivity:
|
||||
checker:
|
||||
target: 1.1.1.1:53
|
||||
interval: 60s
|
||||
|
||||
security:
|
||||
oidc:
|
||||
issuer-url: "{{ opentofu.authentik_data.gatus.base_url }}"
|
||||
redirect-url: "https://{{ gatus_svc.domain }}/authorization-code/callback"
|
||||
client-id: "{{ opentofu.authentik_data.gatus.client_id }}"
|
||||
client-secret: "{{ opentofu.authentik_data.gatus.client_secret }}"
|
||||
scopes: ["openid"]
|
||||
|
||||
alerting:
|
||||
email: "{{ vault_gatus.alerting.email }}"
|
||||
ntfy: "{{ vault_gatus.alerting.ntfy }}"
|
||||
|
||||
external-endpoints: "{{ gatus_external_endpoints_backups }}"
|
||||
endpoints: "{{ gatus_endpoints_hosts | union(gatus_endpoints_services) | union(gatus_endpoints_other) }}"
|
||||
|
||||
gatus_compose:
|
||||
watchtower: true
|
||||
image: twinproduction/gatus
|
||||
volumes:
|
||||
- ./config.yaml:/config/config.yaml
|
||||
- data:/data
|
||||
file:
|
||||
volumes:
|
||||
data:
|
|
@ -38,7 +38,7 @@ check_url "mail.serguzim.me"
|
|||
#check_url "msrg.cc" # disabled because it keeps creating false alerts
|
||||
check_url "rss.serguzim.me"
|
||||
#check_url "serguzim.me" # disabled because it keeps creating false alerts
|
||||
check_url "status.serguzim.me" "/status/serguzim-net"
|
||||
#check_url "status.serguzim.me" "/status/serguzim-net"
|
||||
check_url "tick.serguzim.me"
|
||||
check_url "wiki.serguzim.me"
|
||||
check_url "www.reitanlage-oranienburg.de"
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ svc.name }}
|
||||
vars:
|
||||
svc: "{{ uptime_kuma_svc }}"
|
||||
env: "{{ uptime_kuma_env }}"
|
||||
compose: "{{ uptime_kuma_compose }}"
|
||||
block:
|
||||
- name: Import tasks to deploy common service
|
||||
ansible.builtin.import_tasks: tasks/deploy-common-service.yml
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
uptime_kuma_svc:
|
||||
domain: status.serguzim.me
|
||||
additional_domains:
|
||||
- status.serguzim.net
|
||||
name: uptime-kuma
|
||||
port: 3001
|
||||
|
||||
uptime_kuma_compose:
|
||||
watchtower: true
|
||||
image: louislam/uptime-kuma:1
|
||||
volumes:
|
||||
- data:/app/data
|
||||
file:
|
||||
volumes:
|
||||
data:
|
Loading…
Add table
Add a link
Reference in a new issue