feat: add Beszel service deployment and configuration in Ansible
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 12s
Nix Format Check / check-format (push) Successful in 47s
Python Lint Check / check-python (push) Failing after 9s

This commit is contained in:
Menno van Leeuwen 2025-03-25 04:12:54 +01:00
parent c02431d925
commit 19ad2ab711
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
4 changed files with 55 additions and 1 deletions

View File

@ -37,3 +37,5 @@
enabled: true
- name: dozzle
enabled: true
- name: beszel
enabled: true

View File

@ -0,0 +1,34 @@
---
- name: Deploy Beszel service
block:
- name: Set Beszel directories
ansible.builtin.set_fact:
beszel_service_dir: "{{ ansible_env.HOME }}/services/beszel"
beszel_data_dir: "/mnt/object_storage/services/beszel"
- name: Create Beszel directory
ansible.builtin.file:
path: "{{ beszel_service_dir }}"
state: directory
mode: "0755"
- name: Create Beszel data directory
ansible.builtin.file:
path: "{{ beszel_data_dir }}"
state: directory
mode: "0755"
- name: Deploy Beszel docker-compose.yml
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ beszel_service_dir }}/docker-compose.yml"
mode: "0644"
register: beszel_compose
- name: Stop Beszel service
ansible.builtin.command: docker compose -f "{{ beszel_service_dir }}/docker-compose.yml" down --remove-orphans
when: beszel_compose.changed or beszel_file.changed
- name: Start Beszel service
ansible.builtin.command: docker compose -f "{{ beszel_service_dir }}/docker-compose.yml" up -d
when: beszel_compose.changed or beszel_file.changed

View File

@ -0,0 +1,18 @@
name: monitoring
services:
beszel:
image: 'henrygd/beszel'
restart: unless-stopped
ports:
- '8090:8090'
volumes:
- {{beszel_data_dir}}:/beszel_data
networks:
- beszel-net
- caddy_network
networks:
beszel-net:
caddy_network:
external: true
name: caddy_default

View File

@ -1,6 +1,6 @@
name: monitoring
services:
dozzle:
container_name: dozzle
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock