feat: add Uptime Kuma service deployment configuration
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 16s
Nix Format Check / check-format (push) Successful in 55s
Python Lint Check / check-python (push) Failing after 13s

This commit is contained in:
2025-03-14 22:09:29 +01:00
parent 5c71a02006
commit 5e983c8cd8
2 changed files with 32 additions and 0 deletions

View File

@ -29,3 +29,7 @@
enabled: false
- name: jellyfin
enabled: true
- name: jellyfin
enabled: true
- name: uptime-kuma
enabled: true

View File

@ -0,0 +1,28 @@
---
- name: Deploy Uptime Kuma service
block:
- name: Set Uptime Kuma directories
ansible.builtin.set_fact:
uptime_kuma_service_dir: "{{ ansible_env.HOME }}/services/uptime-kuma"
uptime_kuma_data_dir: "/mnt/object_storage/services/uptime-kuma"
- name: Create Uptime Kuma directory
ansible.builtin.file:
path: "{{ uptime_kuma_service_dir }}"
state: directory
mode: "0755"
- name: Deploy Uptime Kuma docker-compose.yml
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ uptime_kuma_service_dir }}/docker-compose.yml"
mode: "0644"
register: uptime_kuma_compose
- name: Stop Uptime Kuma service if config changed
ansible.builtin.command: docker compose -f "{{ uptime_kuma_service_dir }}/docker-compose.yml" down --remove-orphans
when: uptime_kuma_compose.changed
- name: Start Uptime Kuma service
ansible.builtin.command: docker compose -f "{{ uptime_kuma_service_dir }}/docker-compose.yml" up -d
when: uptime_kuma_compose.changed or uptime_kuma_start | default(false) | bool