aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/meta/argument_specs.yml
diff options
context:
space:
mode:
authorMagnus Kühne <73171182+magkue@users.noreply.github.com>2026-02-09 17:23:57 +0100
committerGitHub <noreply@github.com>2026-02-09 17:23:57 +0100
commit049689c124a274870b5405ff6816beeba7d94a14 (patch)
tree583b94ca62c1268bf359d47309ad24823ba9d458 /meta/argument_specs.yml
parent61a0abc5ac4b5d600ee17fef52d7340a9475ac9b (diff)
downloadansible-role-prometheus-target-049689c124a274870b5405ff6816beeba7d94a14.tar.gz
ansible-role-prometheus-target-049689c124a274870b5405ff6816beeba7d94a14.zip
Add support for YAML strategy
Introduces a new 'yaml' strategy using Ansible's `from_yaml` to read target files. This allows users to group multiple targets with distinct label sets (e.g., severity or job) within a single file, optimizing Prometheus file-based service discovery. - Refactored task structure into `strategy_*.yml` for consistency. - Extracted shared exporter variable computation. - Implemented label merging where exporter labels override defaults. - Included support for groups and hosts without labels to prevent crashes. PR: (#1) https://github.com/kliwniloc/ansible-role-prometheus-target/pull/1
Diffstat (limited to 'meta/argument_specs.yml')
-rw-r--r--meta/argument_specs.yml6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml
index 9126bb8..1d960cf 100644
--- a/meta/argument_specs.yml
+++ b/meta/argument_specs.yml
@@ -24,7 +24,7 @@ argument_specs:
default: lineinfile
choices:
- lineinfile
- # More to be added
+ - yaml
prometheus_target_handler_command_enabled:
type: bool
@@ -91,6 +91,10 @@ argument_specs:
host:
type: str
required: false
+ labels:
+ type: dict
+ required: false
+ description: Labels to match the target group in the YAML file (yaml strategy only)
prometheus_target_default_exporters:
type: list