xoxys.telegraf/tasks/tls.yml
2021-06-03 18:55:27 +02:00

32 lines
894 B
YAML

---
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
recurse: True
loop:
- "{{ telegraf_prometheus_tls_cert_path | dirname }}"
- "{{ telegraf_prometheus_tls_key_path | dirname }}"
- name: Copy certs and private key
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
loop:
- src: "{{ telegraf_prometheus_tls_key_source }}"
dest: "{{ telegraf_prometheus_tls_key_path }}"
owner: telegraf
group: root
mode: "0600"
- src: "{{ telegraf_prometheus_tls_cert_source }}"
dest: "{{ telegraf_prometheus_tls_cert_path }}"
owner: telegraf
group: root
mode: "0750"
loop_control:
label: "{{ item.dest }}"
become: True
become_user: root