aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/defaults
diff options
context:
space:
mode:
authorColin Wilk <colin.wilk@tum.de>2023-06-11 18:53:04 +0200
committerColin Wilk <colin.wilk@tum.de>2023-06-11 18:53:04 +0200
commit232bdca2add4253981b0873188663069f74a0610 (patch)
treef455d26babf600baad72e5e68d02a7f2730e548c /defaults
parent7623b7302f445798fb9d6fe31c1c1eb7085173a4 (diff)
downloadansible-role-prometheus-target-232bdca2add4253981b0873188663069f74a0610.tar.gz
ansible-role-prometheus-target-232bdca2add4253981b0873188663069f74a0610.zip
Add ability to specify target path prefix
This will decrease the amount of redundant configuration for users by allowing them to specify a general prefix on global / exporter / play level Signed-off-by: Colin Wilk <colin.wilk@tum.de>
Diffstat (limited to 'defaults')
-rw-r--r--defaults/main.yml15
1 files changed, 13 insertions, 2 deletions
diff --git a/defaults/main.yml b/defaults/main.yml
index 52afffd..0a8e9ba 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -91,6 +91,16 @@ prometheus_target_strategy_lineinfile_suffix: ''
# Exporter configuration
################################################################################
+# You can configure a target prefix to keep your targets in your exporters
+# configuration. DRY For example if all your target files reside in
+# /opt/prometheus it's a good idea to set the prefix to /opt/prometheus/ so that
+# you can define your remaining target files as just target.yml instead of
+# /opt/prometheus/target.yml
+# In case you have a few exporters that reside in different directories you may
+# ignore the prefix by specifying `path_prefix: ''` in the exporter default
+# or the enabled exporter config.
+prometheus_target_exporter_target_prefix: ''
+
# This will configure the default settings for specified exporters.
# The key in this dict should map to the possible id in the specified exporter
# in prometheus_target_exporter or prometheus_target_default_exporters.
@@ -105,8 +115,9 @@ prometheus_target_exporter_defaults: {}
# path: /opt/prometheus/targets.yml
# host: '{{ inventory_hostname }}:9100'
# blackbox_exporter:
- # path: /opt/prometheus/blackbox.yml
+ # path: /opt/targets/blackbox.yml
# host: 'https://{{ hostvars[inventory_hostname].ansible_host }}'
+ # path_prefix: ''
# This is where you specify the exporters that should be deployed to prometheus.
# You should configure this on a per play basis. If you wish to configure
@@ -125,7 +136,7 @@ prometheus_target_exporter: []
# ignored.
prometheus_target_default_exporters: []
# - { id: node_exporter }
- # - { id: blackbox_exporter, path: /path/to/target }
+ # - { id: blackbox_exporter, path: /path/to/target, path_prefix: '' }
# You can enable this variable to not add exporters defined in
# prometheus_target_default_exporters