[prometheus-alertmanager] use template/first_found instead of merge_yaml.
Change https://review.openstack.org/#/c/571826/4/ introduced the usage of merge_yaml for rendering the prometheus-alertmanager.yml configuration. However the merge_yaml module doesn't do a deep copy of >= second level properties, so it doesn't works for most configurations. Bug: #1786077 Change-Id: I35297c6e2a3800582fb1fd3782a5d93558562b1d Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
This commit is contained in:
parent
cd03e963c6
commit
19ec40170f
@ -44,16 +44,17 @@
|
|||||||
- name: Copying over prometheus alertmanager config file
|
- name: Copying over prometheus alertmanager config file
|
||||||
vars:
|
vars:
|
||||||
service: "{{ prometheus_services['prometheus-alertmanager']}}"
|
service: "{{ prometheus_services['prometheus-alertmanager']}}"
|
||||||
merge_yaml:
|
template:
|
||||||
sources:
|
src: "{{ item }}"
|
||||||
- "{{ node_custom_config }}/prometheus/{{ inventory_hostname }}/prometheus-alertmanager.yml"
|
|
||||||
- "{{ node_custom_config }}/prometheus/prometheus-alertmanager.yml"
|
|
||||||
- "{{ role_path }}/templates/prometheus-alertmanager.yml.j2"
|
|
||||||
dest: "{{ node_config_directory }}/prometheus-alertmanager/prometheus-alertmanager.yml"
|
dest: "{{ node_config_directory }}/prometheus-alertmanager/prometheus-alertmanager.yml"
|
||||||
register: prometheus_confs
|
register: prometheus_confs
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
- service.enabled | bool
|
- service.enabled | bool
|
||||||
|
with_first_found:
|
||||||
|
- "{{ node_custom_config }}/prometheus/{{ inventory_hostname }}/prometheus-alertmanager.yml"
|
||||||
|
- "{{ node_custom_config }}/prometheus/prometheus-alertmanager.yml"
|
||||||
|
- "{{ role_path }}/templates/prometheus-alertmanager.yml.j2"
|
||||||
notify:
|
notify:
|
||||||
- Restart prometheus-alertmanager container
|
- Restart prometheus-alertmanager container
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user