Merge "[prometheus-alertmanager] use template/first_found instead of merge_yaml."

This commit is contained in:
Zuul 2018-08-15 13:36:05 +00:00 committed by Gerrit Code Review
commit a018e60c2a

View File

@ -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