You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults
40
40
|`prometheus_targets`| {} | Targets which will be scraped. Better example is provided in our [demo site](https://github.com/cloudalchemy/demo-site/blob/2a8a56fc10ce613d8b08dc8623230dace6704f9a/group_vars/all/vars#L8)|
41
41
|`prometheus_scrape_configs`|[defaults/main.yml#L58](https://github.com/cloudalchemy/ansible-prometheus/blob/ff7830d06ba57be1177f2b6fca33a4dd2d97dc20/defaults/main.yml#L47)| Prometheus scrape jobs provided in same format as in [official docs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config)|
42
42
|`prometheus_config_file`| "prometheus.yml.j2" | Variable used to provide custom prometheus configuration file in form of ansible template |
43
-
|`prometheus_alert_rules`|[defaults/main.yml#L58](https://github.com/cloudalchemy/ansible-prometheus/blob/ff7830d06ba57be1177f2b6fca33a4dd2d97dc20/defaults/main.yml#L58)| Full list of alerting rules which will be copied to `{{ prometheus_config_dir }}/rules/basic.rules`. Alerting rules can be also provided by other files located in `{{ prometheus_config_dir }}/rules/` which have `*.rules` extension |
43
+
|`prometheus_alert_rules`|[defaults/main.yml#L58](https://github.com/cloudalchemy/ansible-prometheus/blob/ff7830d06ba57be1177f2b6fca33a4dd2d97dc20/defaults/main.yml#L58)| Full list of alerting rules which will be copied to `{{ prometheus_config_dir }}/rules/ansible_managed.rules`. Alerting rules can be also provided by other files located in `{{ prometheus_config_dir }}/rules/` which have `*.rules` extension |
44
44
45
45
### Relation between `prometheus_scrape_configs` and `prometheus_targets`
Copy file name to clipboardExpand all lines: tasks/preflight.yml
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,13 @@
35
35
# when: not item | basename | splitext | difference(['.yml']) | join('') in prometheus_targets.keys()
36
36
with_dict: "{{ prometheus_targets }}"
37
37
38
+
- name: Fail when prometheus_alertmanager_config is empty, but prometheus_alert_rules is specified
39
+
debug:
40
+
msg: "There's no use in defining alerting rules if you're not going to use them! Be sure to specify a prometheus_alertmanager_config in defaults/main.yml if you're going to define prometheus_alert_rules"
0 commit comments