xoxys.telegraf/tasks/tls.yml

31 lines
874 B
YAML
Raw Normal View History

2021-06-03 16:55:27 +00:00
---
- 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 }}"
2021-06-03 21:19:35 +00:00
owner: telegraf
group: root
2021-06-03 16:55:27 +00:00
mode: "{{ item.mode }}"
loop:
- src: "{{ telegraf_prometheus_tls_key_source }}"
dest: "{{ telegraf_prometheus_tls_key_path }}"
mode: "0600"
- src: "{{ telegraf_prometheus_tls_cert_source }}"
dest: "{{ telegraf_prometheus_tls_cert_path }}"
mode: "0750"
loop_control:
label: "{{ item.dest }}"
2021-06-05 15:21:20 +00:00
notify: __telegraf_reload
2021-06-03 16:55:27 +00:00
become: True
become_user: root