diff options
| author | Colin Wilk <colin.wilk@tum.de> | 2023-06-15 22:40:27 +0200 |
|---|---|---|
| committer | Colin Wilk <colin.wilk@tum.de> | 2023-06-15 22:52:07 +0200 |
| commit | 579b168b2c93daee67ede17ee3289da1678b3833 (patch) | |
| tree | 697ffd94cdcb0f8a8e3510947c7aafade4df8594 /molecule/default/tests | |
| parent | cb503dc08f1c1b447d869d48e57069156574a1fd (diff) | |
| download | ansible-role-prometheus-target-1.1.0.tar.gz ansible-role-prometheus-target-1.1.0.zip | |
Add ability to use exporter without id propertyv1.1.0
The id property of the exporter is used for checking the default values
specified in `prometheus_target_exporter_defaults` variable.
However when both the `host` and the `path` fields are specified
manually in the `prometheus_target_exporter` list this id is never
looked up.
The way the templating was handled however, still resulted in an error
when leaving out the id field.
The templating code was now rewritten to allow for the following
exporter configuraion to run:
prometheus_target_exporter:
- { host: exporter_without_id, path: /opt/simple_target4.yml }
Signed-off-by: Colin Wilk <colin.wilk@tum.de>
Diffstat (limited to 'molecule/default/tests')
| -rw-r--r-- | molecule/default/tests/test_check_prometheus_targets.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/molecule/default/tests/test_check_prometheus_targets.py b/molecule/default/tests/test_check_prometheus_targets.py index 9ce1056..ddf3a22 100644 --- a/molecule/default/tests/test_check_prometheus_targets.py +++ b/molecule/default/tests/test_check_prometheus_targets.py @@ -7,10 +7,12 @@ def test_check_hosts_added_simple(host): t1 = host.file('/opt/simple_target1.yml') t2 = host.file('/opt/simple_target2.yml') t3 = host.file('/opt/simple_target3.yml') + t4 = host.file('/opt/simple_target4.yml') assert t1.exists assert t2.exists assert t3.exists + assert t4.exists assert t1.content_string == \ ' - application\n' @@ -23,6 +25,9 @@ def test_check_hosts_added_simple(host): assert t3.content_string == \ ' - application_AA\n' + assert t4.content_string == \ + ' - exporter_without_id\n' + """ Test prefix functionality """ |