[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:
Jorge Niedbalski 2018-08-08 12:30:38 -04:00
parent cd03e963c6
commit 19ec40170f

View File

@ -44,16 +44,17 @@
- name: Copying over prometheus alertmanager config file
vars:
service: "{{ prometheus_services['prometheus-alertmanager']}}"
merge_yaml:
sources:
- "{{ node_custom_config }}/prometheus/{{ inventory_hostname }}/prometheus-alertmanager.yml"
- "{{ node_custom_config }}/prometheus/prometheus-alertmanager.yml"
- "{{ role_path }}/templates/prometheus-alertmanager.yml.j2"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/prometheus-alertmanager/prometheus-alertmanager.yml"
register: prometheus_confs
when:
- inventory_hostname in groups[service.group]
- 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:
- Restart prometheus-alertmanager container