From ca2cc8da62b85a2ca4006a002b96304958fb8d6b Mon Sep 17 00:00:00 2001 From: s3lph Date: Thu, 8 Dec 2022 01:03:34 +0100 Subject: [PATCH] Add bearer auth to scrape config template --- galaxy.yml | 2 +- .../templates/etc/prometheus/prometheus.yml.j2 | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 582b2f2..78301ef 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: s3lph name: prometheus # The version of the collection. Must be compatible with semantic versioning -version: 0.9.0 +version: 0.9.1 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/roles/prometheus/templates/etc/prometheus/prometheus.yml.j2 b/roles/prometheus/templates/etc/prometheus/prometheus.yml.j2 index 3ecdfec..d143123 100644 --- a/roles/prometheus/templates/etc/prometheus/prometheus.yml.j2 +++ b/roles/prometheus/templates/etc/prometheus/prometheus.yml.j2 @@ -58,6 +58,16 @@ scrape_configs: password: {{ job.basic_auth_password }} {% endif %} +{% if 'authorization' in job %} + authorization: +{% if 'type' in job.authorization %} + type: {{ job.authorization.type }} +{% endif %} +{% if 'credentials' in job.authorization %} + credentials: {{ job.authorization.credentials }} +{% endif %} +{% endif %} + {% if 'tls_config' in job %} tls_config: ca_file: {{ job.tls_config.ca_file }}