ansible icon indicating copy to clipboard operation
ansible copied to clipboard

Process Exporter Service failing due to error in Config file

Open prakyathraj opened this issue 1 year ago • 2 comments

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

prakyathraj avatar May 10 '24 10:05 prakyathraj

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.

gitperr avatar May 18 '24 15:05 gitperr

@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

gardar avatar Oct 18 '24 18:10 gardar