-
Notifications
You must be signed in to change notification settings - Fork 138
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
prometheus_alert_rules_files no longer works as expected since 0.20.0 #454
Comments
The
Not sure why the argument spec validation isn't catching this, it was also reported in #444 When you run your playbook, do you see a task named |
Thanks, changing to:
... fixed the issue:
With my previous config, my mistake wasn't caught:
|
I figure, the check/validation might be incomplete, because it's skipping:
It looks only for matches ending in - name: Validate that prometheus_alert_rules_files is a list
ansible.builtin.assert:
that:
- prometheus_alert_rules_files is iterable
- prometheus_alert_rules_files is not string
fail_msg: '`prometheus_alert_rules_files` must be a list'
success_msg: '`prometheus_alert_rules_files` is a list'
when:
- prometheus_alert_rules_files is defined Can do PR if you want. |
That assert task was introduced in #333 and is to help users migrating from .rules to .yml and is unrelated to this. While we could definitely add a task to validate each variable I don't think it's the right thing to do as it is the purpose of the Role argument validation which we have already in place roles/prometheus/meta/argument_specs.yml, we just need to investigate why it's not working as expected. |
Looks like this is by design as apparently the argument validation is currently just for ensuring the variable can be converted into the type specified in the argument spec and is not for enforcing the type of the variable. In the meantime we could probably just convert the |
Just wanted to update the collection to latest, and I recognized this diff.
This is output with older version 0.17.0:
This is with current latest 0.22.0:
These are the files in my top-level ansible directory from where I run my top-level playbooks:
So there seems to be something wrong with the globbing happening with
prometheus_alert_rules_files
and theCopy custom alerting rule files
task. The diff from 0.17.0 to 0.22.0 (git diff 0.17.0..0.22.0 roles/prometheus/tasks/configure.yml
):This was done in 1e4e4c3 before the 0.20.0 release.
The text was updated successfully, but these errors were encountered: