Deploy a dashboard monitor for the entire server
This commit is contained in:
parent
a08dde8864
commit
55241638c8
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -63,13 +63,22 @@
|
||||
<h2>System Nodes</h2>
|
||||
<div class="grid">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span id="status-ipa" class="status-indicator online"></span>
|
||||
<h3>freeipa</h3>
|
||||
</div>
|
||||
<p class="ip">172.30.1.100</p>
|
||||
<p class="role">Identity & Local DNS</p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span id="status-control" class="status-indicator online"></span>
|
||||
<h3>ansible-control</h3>
|
||||
</div>
|
||||
<p class="ip">172.30.1.200</p>
|
||||
<p class="role">Automation AAP & Engine</p>
|
||||
<p class="role">Automation Engine</p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
@ -87,7 +96,7 @@
|
||||
<h3>media-stream</h3>
|
||||
</div>
|
||||
<p class="ip">172.30.1.202</p>
|
||||
<p class="role">Navidrome & Rclone FUSE</p>
|
||||
<p class="role">Navidrome Music & FUSE</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -108,6 +117,26 @@
|
||||
<span class="action-btn">Launch Service →</span>
|
||||
</a>
|
||||
|
||||
<!-- Gitea Link -->
|
||||
<a href="http://172.30.1.200:3000" target="_blank" class="card link-card">
|
||||
<div class="card-header">
|
||||
<span class="status-indicator online"></span>
|
||||
<h3>Gitea Git Server</h3>
|
||||
</div>
|
||||
<p class="desc">Private self-hosted Git repository and GitOps CI/CD engine.</p>
|
||||
<span class="action-btn">Open Gitea →</span>
|
||||
</a>
|
||||
|
||||
<!-- FreeIPA Link -->
|
||||
<a href="https://ipa.shooey.local/ipa/ui" target="_blank" class="card link-card">
|
||||
<div class="card-header">
|
||||
<span class="status-indicator online"></span>
|
||||
<h3>FreeIPA Directory</h3>
|
||||
</div>
|
||||
<p class="desc">Centralized Kerberos/LDAP accounts and local BIND DNS.</p>
|
||||
<span class="action-btn">Open FreeIPA →</span>
|
||||
</a>
|
||||
|
||||
<!-- VM Cockpit Link -->
|
||||
<a href="https://172.30.1.202:9090" target="_blank" class="card link-card">
|
||||
<div class="card-header">
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user