Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
prakyathraj opened this issue May 10, 2024 · 2 comments
Open

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

prakyathraj opened this issue May 10, 2024 · 2 comments

Comments

@prakyathraj
Copy link

prakyathraj commented May 10, 2024

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 prakyathraj changed the title Process Exporter Role due to error in Config file Process Exporter Role failing due to error in Config file May 10, 2024
@prakyathraj prakyathraj changed the title Process Exporter Role failing due to error in Config file Process Exporter Service failing due to error in Config file May 10, 2024
@gitperr
Copy link

gitperr commented May 18, 2024

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
Copy link
Member

gardar commented Oct 18, 2024

@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

process_exporter_names: |
{% raw %}
- name: "{{.Comm}}"
cmdline:
- systemd
- name: "{{.Comm}}"
cmdline:
- systemd-journald
- name: "{{.Comm}}"
cmdline:
- crond
{% endraw %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants