diff --git a/ansible/roles/prometheus/tasks/config.yml b/ansible/roles/prometheus/tasks/config.yml index b9591e346e..981af0f5a0 100644 --- a/ansible/roles/prometheus/tasks/config.yml +++ b/ansible/roles/prometheus/tasks/config.yml @@ -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