From 2c68499a101223f14bcd531000aad6b9c6e4f805 Mon Sep 17 00:00:00 2001 From: "pulsar89.5" Date: Fri, 13 Nov 2026 18:40:05 +0100 Subject: [PATCH] Hide API key from task output and syslog --- defaults/main.yml | 3 +++ tasks/checks.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index e892e60..49e361c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,9 @@ hcio_path: /srv/healthchecksio hcio_url: "" hcio_api_key: "" +# Hide API calls output, they contain the API key. Set to false to debug. +hcio_no_log: true + # Add prefix on slug hcio_slug_prefix: "{{ inventory_hostname | replace('.', '_') }}-" diff --git a/tasks/checks.yml b/tasks/checks.yml index 574367e..32b7c02 100644 --- a/tasks/checks.yml +++ b/tasks/checks.yml @@ -22,6 +22,8 @@ when: uuid | length <= 0 changed_when: true register: created + # Hide the API key (task output and syslog on the instance) + no_log: "{{ hcio_no_log }}" loop: "{{ hcio_checks }}" loop_control: label: "{{ item.name }}" @@ -54,6 +56,8 @@ "channels": "{{ channels }}" } when: uuid | length > 0 + # Hide the API key (task output and syslog on the instance) + no_log: "{{ hcio_no_log }}" loop: "{{ hcio_checks }}" loop_control: label: "{{ item.name }}" -- 2.47.3