xoxys.alertmanager/tasks/tls.yml

33 lines
928 B
YAML
Raw Normal View History

2021-06-02 22:01:24 +00:00
---
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
owner: "{{ alertmanager_user }}"
group: "{{ alertmanager_group }}"
recurse: True
loop:
- "{{ alertmanager_web_tls_cert_path | dirname }}"
- "{{ alertmanager_web_tls_key_path | dirname }}"
become: True
become_user: root
- block:
- name: Copy certs and private key
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
loop:
- src: "{{ alertmanager_web_tls_key_source }}"
dest: "{{ alertmanager_web_tls_key_path }}"
mode: "0600"
- src: "{{ alertmanager_web_tls_cert_source }}"
dest: "{{ alertmanager_web_tls_cert_path }}"
mode: "0750"
loop_control:
label: "{{ item.dest }}"
become: True
become_user: "{{ alertmanager_user }}"