Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] uptime kuma #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
- noc
- pushgateway

- name: kuma
role: roles/kuma
tags:
- noc
- kuma

- name: mgmt
role: roles/mgmt
tags: mgmt
20 changes: 20 additions & 0 deletions roles/kuma/README-kuma.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Kuma

## About

Uptime Kuma is an easy-to-use self-hosted monitoring tool, similar to uptime
robot but free and open source.

## Install notes

- https://github.com/louislam/uptime-kuma
- https://hub.docker.com/r/louislam/uptime-kuma

```sh
docker run -d \
--restart=always \
-p 3001:3001 \
-v uptime-kuma:/app/data \
--name uptime-kuma \
louislam/uptime-kuma:1
```
32 changes: 32 additions & 0 deletions roles/kuma/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---

- name: Create the Kuma volume
file:
path: "{{ data_path }}/kuma/data"
state: directory

- name: Run Kuma
docker_container:
name: "{{ kuma_container_name }}"
image: "{{ kuma_image_qualified }}"
detach: yes
restart_policy: unless-stopped
recreate: >-
{{
(kuma_config_files is defined and kuma_config_files is changed)
or
(kuma_templates is defined and kuma_templates is changed)
}}
network_mode: "{{ backend_network_name }}"
volumes:
- "{{ data_path }}/kuma/data:/app/data"
log_driver: json-file
log_options:
max-size: 50m
max-file: "3"
labels:
traefik.enable: "true"
traefik.http.routers.kuma.rule: "Host(`kuma.noc{{ dns_suffix }}.{{ frontend.domain }}`)"
traefik.http.routers.kuma.entrypoints: "websecure"
traefik.http.routers.kuma.tls.certresolver: "letsencrypt"
traefik.docker.network: "{{ backend_network_name }}"
7 changes: 7 additions & 0 deletions roles/kuma/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# vars for Kuma
kuma_port: 3001
kuma_container_name: "kuma"
kuma_image: "louislam/uptime-kuma"
kuma_version: "1"
kuma_image_qualified: "{{ kuma_image }}:{{ kuma_version }}"