Add support for custom alert notification templates
Change-Id: I9e4e1287ea69960ae3b13734acc3eb0b087a8d86
This commit is contained in:
parent
5645a4c008
commit
77e811e25c
@ -115,6 +115,32 @@
|
||||
notify:
|
||||
- Restart prometheus-alertmanager container
|
||||
|
||||
- name: Find custom Alertmanager alert notification templates
|
||||
find:
|
||||
path: "{{ node_custom_config }}/prometheus/"
|
||||
pattern: "*.tmpl"
|
||||
run_once: True
|
||||
delegate_to: localhost
|
||||
register: alertmanager_notification_templates
|
||||
when:
|
||||
- enable_prometheus_alertmanager | bool
|
||||
|
||||
- name: Copying over custom Alertmanager alert notification templates
|
||||
become: true
|
||||
vars:
|
||||
service: "{{ prometheus_services['prometheus-alertmanager'] }}"
|
||||
copy:
|
||||
src: "{{ item.path }}"
|
||||
dest: "{{ node_config_directory }}/prometheus-alertmanager/{{ item.path | basename }}"
|
||||
mode: 0660
|
||||
when:
|
||||
- inventory_hostname in groups[service.group]
|
||||
- service.enabled | bool
|
||||
- alertmanager_notification_templates is defined and alertmanager_notification_templates.files | length > 0
|
||||
with_items: "{{ alertmanager_notification_templates.files }}"
|
||||
notify:
|
||||
- Restart prometheus-alertmanager container
|
||||
|
||||
- name: Copying over my.cnf for mysqld_exporter
|
||||
become: true
|
||||
vars:
|
||||
|
@ -6,6 +6,13 @@
|
||||
"dest": "/etc/prometheus/alertmanager.yml",
|
||||
"owner": "prometheus",
|
||||
"perm": "0600"
|
||||
},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/*.tmpl",
|
||||
"dest": "/etc/prometheus/",
|
||||
"optional": true,
|
||||
"owner": "prometheus",
|
||||
"perm": "0600"
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
|
@ -17,4 +17,5 @@ receivers:
|
||||
username: '{{ keystone_admin_user }}'
|
||||
password: '{{ keystone_admin_password }}'
|
||||
{% endif %}
|
||||
templates: []
|
||||
templates:
|
||||
- '/etc/prometheus/*.tmpl'
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Adds possibility for inlcuding custom alert notification templates with
|
||||
Prometheus Alertmanager.
|
Loading…
Reference in New Issue
Block a user