hermes: add hermes-dashboard systemd unit (port 9119, fronted by Traefik)
This commit is contained in:
@@ -8,8 +8,19 @@ hermes_home: /home/hermes
|
||||
# Set to true if you don't need browser automation (skips Playwright/Chromium)
|
||||
hermes_skip_browser: false
|
||||
|
||||
# systemd service name
|
||||
# systemd service name (gateway)
|
||||
hermes_service_name: hermes
|
||||
|
||||
# Path where hermes binary will be accessible system-wide
|
||||
hermes_bin_symlink: /usr/local/bin/hermes
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Hermes Web UI (dashboard) — fronted by Traefik on lightning-lane via the
|
||||
# 'jarvis' service. Binds to 0.0.0.0 so Traefik can reach it from upstream;
|
||||
# --insecure is acceptable because TLS + auth are terminated at Traefik.
|
||||
# -----------------------------------------------------------------------------
|
||||
hermes_dashboard_enabled: true
|
||||
hermes_dashboard_service_name: hermes-dashboard
|
||||
hermes_dashboard_host: 0.0.0.0
|
||||
hermes_dashboard_port: 9119
|
||||
hermes_dashboard_insecure: true
|
||||
|
||||
@@ -154,3 +154,46 @@
|
||||
enabled: true
|
||||
state: stopped
|
||||
become: true
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 7. Install systemd service unit for the Hermes Web UI (dashboard)
|
||||
# Separate unit from the gateway so the UI can be restarted / disabled
|
||||
# independently. Fronted upstream by Traefik (jarvis service) on
|
||||
# lightning-lane, so binding 0.0.0.0 with --insecure is intentional.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
- name: Deploy hermes-dashboard systemd service unit
|
||||
ansible.builtin.template:
|
||||
src: hermes-dashboard.service.j2
|
||||
dest: /etc/systemd/system/{{ hermes_dashboard_service_name }}.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
become: true
|
||||
register: hermes_dashboard_unit
|
||||
when: hermes_dashboard_enabled
|
||||
|
||||
- name: Reload systemd to pick up hermes-dashboard unit changes
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
become: true
|
||||
when:
|
||||
- hermes_dashboard_enabled
|
||||
- hermes_dashboard_unit is changed
|
||||
|
||||
- name: Enable and start hermes-dashboard service
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ hermes_dashboard_service_name }}"
|
||||
enabled: true
|
||||
state: started
|
||||
become: true
|
||||
when: hermes_dashboard_enabled
|
||||
|
||||
- name: Restart hermes-dashboard on unit change
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ hermes_dashboard_service_name }}"
|
||||
state: restarted
|
||||
become: true
|
||||
when:
|
||||
- hermes_dashboard_enabled
|
||||
- hermes_dashboard_unit is changed
|
||||
|
||||
24
ansible/roles/hermes/templates/hermes-dashboard.service.j2
Normal file
24
ansible/roles/hermes/templates/hermes-dashboard.service.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
[Unit]
|
||||
Description=Hermes Dashboard (Web UI)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ hermes_user }}
|
||||
Group={{ hermes_group }}
|
||||
WorkingDirectory={{ hermes_home }}
|
||||
Environment="HOME={{ hermes_home }}"
|
||||
Environment="PATH={{ hermes_home }}/.local/bin:/usr/local/bin:/usr/bin:/bin"
|
||||
Environment="HERMES_HOME={{ hermes_home }}/.hermes"
|
||||
ExecStart={{ hermes_home }}/.hermes/hermes-agent/venv/bin/hermes dashboard --host {{ hermes_dashboard_host }} --port {{ hermes_dashboard_port }}{% if hermes_dashboard_insecure %} --insecure{% endif %}
|
||||
|
||||
TimeoutStopSec=30
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=hermes-dashboard
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user