Hindsight-LXC: Gate (E14) nachgezogen – Image 0abbca1, keys.json per Ansible, Jobs über 8889, Blackbox-Probe auf /health
nex-hindsight main (0abbca1, 22.10.) stellt ein Gate vor Port 8888: HINDSIGHT_API_URL für die
Jobs im LXC auf 127.0.0.1:8889, GATE_KEYS_DIR, keys.json (nur Hashes) aus ops
/root/.config/knaster/hindsight-gate-keys.json oder einmalig {}. Freigabeliste um Laptop-WLAN und
die k3s-Knoten (NEX-Pods, SNAT) ergänzt. /metrics liegt hinter dem Gate, deshalb Blackbox-Exporter
im Infra-Stack und Alert HindsightDown auf probe_success. Rulings 10–12 im Auftrag, BETRIEB §16.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit was merged in pull request #2.
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
- {path: "{{ hindsight_state_dir }}/backup", mode: "0700"}
|
||||
- {path: "{{ hindsight_state_dir }}/export", mode: "0700"}
|
||||
- {path: "{{ hindsight_state_dir }}/logs", mode: "0755"}
|
||||
- {path: "{{ hindsight_state_dir }}/gate", mode: "0700"}
|
||||
|
||||
# Nie .git, node_modules oder .env-Dateien; Container-Benutzer müssen lesen können
|
||||
- name: Repo nex-hindsight von ops abgleichen
|
||||
@@ -99,6 +100,32 @@
|
||||
label: "{{ item.0 }}"
|
||||
no_log: true
|
||||
|
||||
# Gate-Schlüssel (nur Hashes) von ops; das Gate liest die Datei bei Änderung neu, ohne Neustart. Ohne Datei auf ops
|
||||
# bleibt ein einmal angelegtes {} stehen (nie überschrieben), damit ein späterer Lauf keine Schlüssel löscht.
|
||||
- name: Gate-Schlüsseldatei auf ops vorhanden?
|
||||
ansible.builtin.stat:
|
||||
path: "{{ hindsight_gate_keys_src }}"
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
register: gate_keys_src
|
||||
|
||||
- name: Gate-Schlüssel (keys.json) aus ops übernehmen
|
||||
ansible.builtin.copy:
|
||||
src: "{{ hindsight_gate_keys_src }}"
|
||||
dest: "{{ hindsight_state_dir }}/gate/keys.json"
|
||||
mode: "0600"
|
||||
validate: python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); assert isinstance(d, dict)' %s
|
||||
when: gate_keys_src.stat.exists
|
||||
no_log: true
|
||||
|
||||
- name: Gate ohne Schlüssel (leeres keys.json, nur einmal)
|
||||
ansible.builtin.copy:
|
||||
content: "{}\n"
|
||||
dest: "{{ hindsight_state_dir }}/gate/keys.json"
|
||||
mode: "0600"
|
||||
force: false
|
||||
when: not gate_keys_src.stat.exists
|
||||
|
||||
- name: .env prüfen (Altnamen, CHANGE_ME-Reste)
|
||||
ansible.builtin.command: node {{ hindsight_repo_dir }}/scripts/validate.mjs --env {{ hindsight_state_dir }}/.env
|
||||
changed_when: false
|
||||
@@ -195,7 +222,7 @@
|
||||
register: compose_up
|
||||
changed_when: compose_up.stderr is search('Container \S+\s+(Created|Recreated|Started)')
|
||||
|
||||
- name: Warten, bis die API gesund ist
|
||||
- name: Warten, bis das Gate gesund ist (/health ist ohne Schlüssel erreichbar)
|
||||
ansible.builtin.uri:
|
||||
url: "http://127.0.0.1:{{ hindsight_api_port }}/health"
|
||||
status_code: 200
|
||||
|
||||
Reference in New Issue
Block a user