From 55241638c849aa94d70bed269a7e7da92d6f9c04 Mon Sep 17 00:00:00 2001 From: Isshi0417 Date: Wed, 8 Jul 2026 05:15:34 +0000 Subject: [PATCH] Deploy a dashboard monitor for the entire server --- .gitea/workflows/deploy.yml | 2 +- ansible/deploy_monitor.yml | 16 ++++++++-------- website/index.html | 33 +++++++++++++++++++++++++++++++-- website/script.js | 1 + 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 5c3b3e2..370fad1 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -40,4 +40,4 @@ jobs: - name: Execute DNS playbook run: | cd ansible - ansible-playbook configure_dns.yml -i inventory.ini --vault-password-file vault_pass + ansible-playbook deploy_monitor.yml -i inventory.ini --vault-password-file vault_pass diff --git a/ansible/deploy_monitor.yml b/ansible/deploy_monitor.yml index 0d377c3..b9e95b9 100644 --- a/ansible/deploy_monitor.yml +++ b/ansible/deploy_monitor.yml @@ -7,7 +7,7 @@ - name: Deploy portal website files ansible.builtin.copy: src: ../website/ - dest: /usr/share/nginx/html/ + dest: /usr/share/nginx/html owner: root group: root mode: "0644" @@ -23,19 +23,19 @@ import os hosts = { - "control": "172.30.1.200", + "control": "172.30.1.00", "web": "172.30.1.201", - "media": "172.30.1.202" + "media": '172.30.1.202' } status = {} for name, ip in hosts.items(): - res = subprocess.run(["ping", "-c", "1", "-W", "1", ip], stdout=subprocess.DEVNULL) + res = subprocess.run(["ping", "-c", "1", "-W", "1", "ip"], stdout=subprocess.DEVNULL) status[name] = (res.returncode == 0) output_path = "/usr/share/nginx/html/status.json" - with open(output_path, "w") as f: + with open(output_path, "W") as f: json.dump(status, f) dest: /usr/share/nginx/html/ping_status.py owner: root @@ -51,7 +51,7 @@ [Service] Type=simple - ExecStart=/bin/bash -c "while true; do /usr/bin/python3 /usr/share/nginx/html/ping_status.py; sleep 10; done" + ExecStart=/bin/bash -c "While true; do /usr/bin/python3 /usr/share/nginx/html/ping_status.py; sleep 10; done" Restart=always [Install] @@ -62,7 +62,7 @@ mode: "0644" notify: Reload systemd - - name: Start and enabled homelab-monitor service + - name: Start and enable homelab-monitor service ansible.builtin.systemd: name: homelab-monitor state: started @@ -71,7 +71,7 @@ handlers: - name: Restore SELinux contexts ansible.builtin.command: - cmd: restorecon -Rv /usr/share/nginx/html/ + cmd: restorecon -Rv /usr/share/nginx/html changed_when: false - name: Reload systemd diff --git a/website/index.html b/website/index.html index 80cfb4e..3721841 100644 --- a/website/index.html +++ b/website/index.html @@ -63,13 +63,22 @@

System Nodes

+
+
+ +

freeipa

+
+

172.30.1.100

+

Identity & Local DNS

+
+

ansible-control

172.30.1.200

-

Automation AAP & Engine

+

Automation Engine

@@ -87,7 +96,7 @@

media-stream

172.30.1.202

-

Navidrome & Rclone FUSE

+

Navidrome Music & FUSE

@@ -108,6 +117,26 @@ Launch Service → + + +
+ +

Gitea Git Server

+
+

Private self-hosted Git repository and GitOps CI/CD engine.

+ Open Gitea → +
+ + + +
+ +

FreeIPA Directory

+
+

Centralized Kerberos/LDAP accounts and local BIND DNS.

+ Open FreeIPA → +
+
diff --git a/website/script.js b/website/script.js index f9933fc..205a9b8 100644 --- a/website/script.js +++ b/website/script.js @@ -119,6 +119,7 @@ function updateNodeStatuses() { return res.json(); }) .then(data => { + updateIndicator('status-ipa', data.ipa); updateIndicator('status-control', data.control); updateIndicator('status-web', data.web); updateIndicator('status-media', data.media);