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

fix: use with_fileglob for iterating over custom alerting rule files #488

Closed
wants to merge 1 commit into from

Conversation

MajorP93
Copy link

@MajorP93 MajorP93 commented Dec 5, 2024

Fixes #484

@gardar
Copy link
Member

gardar commented Feb 18, 2025

I fixed the issue using an absolute path when configuring prometheus_alert_rules_files, like this:


prometheus_alert_rules_files:

  - "{{ playbook_dir }}/roles/prometheus/prometheus/rules/generic/*.yml"

The other thing I noticed is that doing {{ prometheus_alert_rules_files | map('ansible.builtin.fileglob') | flatten returns relative paths if you configure prometheus_alert_rules_files with relative paths, which is problematic with the use of ansible.builtin.copy. When using with_fileglob, the paths returned are always absolute.

Originally posted by @lsimard in #484

@gardar gardar closed this Feb 18, 2025
@gardar gardar added the invalid This doesn't seem right label Feb 18, 2025
Copy link
Contributor

Docs Build 📝

This PR is closed and any previously published docsite has been unpublished.

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

Successfully merging this pull request may close these issues.

Prometheus custom rules not copying to rules folder
2 participants