ansible-collection-prometheus/roles/alertmanager/tasks/configure.yml
prombot e39934bc49
fix: Don't log config deployments
Avoid logging on some config files may contain secrets.

Fixes: https://github.com/prometheus-community/ansible/issues/72

Signed-off-by: prombot <prometheus-team@googlegroups.com>
2023-03-17 11:34:30 +01:00

44 lines
1.2 KiB
YAML

---
- name: Copy amtool config
ansible.builtin.template:
force: true
src: "{{ alertmanager_amtool_config_file }}"
dest: "{{ _alertmanager_amtool_config_dir }}/config.yml"
owner: alertmanager
group: alertmanager
mode: 0644
- name: Copy alertmanager config
ansible.builtin.template:
force: true
src: "{{ alertmanager_config_file }}"
dest: "{{ alertmanager_config_dir }}/alertmanager.yml"
owner: alertmanager
group: alertmanager
mode: 0644
validate: "{{ _alertmanager_binary_install_dir }}/amtool check-config %s"
no_log: "{{ 'false' if lookup('env', 'CI') else 'true' }}"
notify:
- restart alertmanager
- name: Create systemd service unit
ansible.builtin.template:
src: alertmanager.service.j2
dest: /etc/systemd/system/alertmanager.service
owner: root
group: root
mode: 0644
notify:
- restart alertmanager
- name: Copy alertmanager template files
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ alertmanager_config_dir }}/templates/"
force: true
owner: alertmanager
group: alertmanager
mode: 0644
with_fileglob: "{{ alertmanager_template_files }}"
notify:
- restart alertmanager