Loki sert son API en HTTPS via le cert step-ca (http_tls_config + cert-sync owned loki, motif .path). Alloy pousse en https + tls_config (ca=root_ca). Vars : serveur_loki_tls_actif, client_journal_loki_tls. Prouvé : Loki HTTPS /ready 200 (vérif root_ca), HTTP rejeté (400), 4 hôtes expédient des logs en https, 0 erreur loki.write après la transition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
479 B
Django/Jinja
21 lines
479 B
Django/Jinja
// Gere par Set-OPS (role client_journal). Ne pas editer a la main.
|
|
|
|
loki.write "loki" {
|
|
endpoint {
|
|
url = "{{ client_journal_loki_url }}"
|
|
{% if client_journal_loki_tls | default(false) %}
|
|
tls_config {
|
|
ca_file = "{{ client_journal_loki_ca }}"
|
|
}
|
|
{% endif %}
|
|
}
|
|
}
|
|
|
|
loki.source.journal "journal" {
|
|
forward_to = [loki.write.loki.receiver]
|
|
max_age = "12h"
|
|
labels = {
|
|
job = "systemd-journal",
|
|
host = "{{ inventory_hostname }}",
|
|
}
|
|
}
|