diff options
author | 2024-07-21 10:01:45 +0100 | |
---|---|---|
committer | 2024-07-21 10:11:35 +0100 | |
commit | abacdeb0580930e763671fb2dbea793a2dcb3c14 (patch) | |
tree | ed232b194a2d95684e8771257dff8ea193e3fc77 | |
parent | Remove /etc/hosts alias for FQDN to 127.0.0.1 on hosts (diff) |
Template hostname in Alloy to the inventory hostname
This maintains previous behaviour in which the hostname would have just
been the inventory hostname, but as the hostname is being updated to the
FQDN we should explicitly set the inventory_hostname to ensure
continuity of logs.
Signed-off-by: Joe Banks <[email protected]>
-rw-r--r-- | ansible/roles/alloy/templates/config.alloy.j2 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ansible/roles/alloy/templates/config.alloy.j2 b/ansible/roles/alloy/templates/config.alloy.j2 index aecf34c..805d167 100644 --- a/ansible/roles/alloy/templates/config.alloy.j2 +++ b/ansible/roles/alloy/templates/config.alloy.j2 @@ -35,7 +35,7 @@ loki.process "ansible_{{ extra.name }}" { loki.write "pydis_gateway" { external_labels = { - hostname = env("HOSTNAME"), + hostname = "{{ inventory_hostname }}", } endpoint { url = "{{ alloy_loki_endpoint }}/loki/api/v1/push" |