prometheus-community / ansible

Ansible Collection for Prometheus
https://prometheus-community.github.io/ansible/
Apache License 2.0
393 stars 133 forks source link

Process Exporter Service failing due to error in Config file #358

Open prakyathraj opened 6 months ago

prakyathraj commented 6 months ago

process_exporter_names attribute is passed as string in Json format as suggested in doc https://prometheus-community.github.io/ansible/branch/main/process_exporter_role.html . Even though it works with default value, it fails when we set custom values. So, we need to pass value in same line instead of newline as done in manual Fix screenshot.

Screenshot 2024-05-10 at 4 30 55 PM

Issue: Screenshot 2024-05-10 at 4 30 01 PM Screenshot 2024-05-10 at 4 21 51 PM

Fix: Screenshot 2024-05-10 at 4 28 18 PM

gitperr commented 6 months ago

It should also be working on newline, could it be because of spacing with custom values?

YAML can be quite unpredictable with scoping sometimes.

It would be useful if you added some before / after code in jinja and templated to yaml to see what errors out.

gardar commented 1 month ago

@prakyathraj please post the variable you are attempting to use.

Btw, you can take a look at the alternative molecule scenario for more examples of a working config https://github.com/prometheus-community/ansible/blob/f3514a9e97dfc3d64f02aefd299487efd99e779f/roles/process_exporter/molecule/alternative/molecule.yml#L18-L29