mesaguy / ansible-prometheus

Ansible role for the management of Prometheus software and Prometheus exporters
https://galaxy.ansible.com/mesaguy/prometheus
MIT License
71 stars 31 forks source link

Timing issue on deploy. #10

Closed tfalkowski-nsidc closed 4 years ago

tfalkowski-nsidc commented 4 years ago

Hey mesaguy,

Thanks for the recent update for implementing the rules directory.

I am running in to an issue which I believe is a timing issue. When I try to build with the rules_file: parameter defined in my prometheus.yml file it fails trying to validate the file. I believe this is a result of the rules directory and files not being present when it attempts to validate.

Section in prometheus.yml

rule_files:
 #- /etc/prometheus/rules/rules.yml
 - /opt/prometheus/etc/rules/

Note: neither of the paths above seem to pass validation.

Here is the error:

TASK [mesaguy.prometheus : Setup prometheus-v2.16.0 configuration file] ********
fatal: [server.example.com]: FAILED! => {"changed": false, "checksum": "8311456b0852d76683984c4434af49d5a5e16419", "exit_status": 1, "msg": "failed to validate", "stderr": "  FAILED: \"/opt/prometheus/etc/rules/\" does not point to an existing file\n", "stderr_lines": ["  FAILED: \"/opt/prometheus/etc/rules/\" does not point to an existing file"], 

Thanks in advance for your help.

tfalkowski-nsidc commented 4 years ago

Seems I may gave jumped the gun filling this issue. Looks like the solution to this issue is to use a *.yml on the end of the rules_files: var in the prometheus.yml file. For example:

rule_files:
 - /opt/prometheus/etc/rules/*.yml

Thanks again, Cheers