feat(alertmanager_receiver): add role
This commit is contained in:
12
roles/alertmanager_receiver/tasks/configure.yml
Normal file
12
roles/alertmanager_receiver/tasks/configure.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Ensure configuration folder '{{ alertmanager_receiver_config_path }}' is {{ alertmanager_receiver_state }}
|
||||
ansible.builtin.file:
|
||||
path: "{{ alertmanager_receiver_config_path }}"
|
||||
state: >-2
|
||||
{{ (alertmanager_receiver_state == 'present') | ternary('directory', 'absent') }}
|
||||
|
||||
- name: Ensure configuration file '{{ alertmanager_receiver_config_file_path }}' is written
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ alertmanager_receiver_config_file_path }}"
|
||||
content: "{{ alertmanager_receiver_merged_config | to_nice_yaml(indent=2, width=200) }}"
|
||||
when: alertmanager_receiver_state == 'present'
|
Reference in New Issue
Block a user