xoxys.prometheus/tasks/tls.yml

33 lines
910 B
YAML
Raw Normal View History

2021-05-29 15:52:24 +00:00
---
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
owner: "{{ prometheus_user }}"
group: "{{ prometheus_group }}"
recurse: True
loop:
- "{{ prometheus_web_tls_cert_path | dirname }}"
- "{{ prometheus_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: "{{ prometheus_web_tls_key_source }}"
dest: "{{ prometheus_web_tls_key_path }}"
mode: "0600"
- src: "{{ prometheus_web_tls_cert_source }}"
dest: "{{ prometheus_web_tls_cert_path }}"
mode: "0750"
loop_control:
label: "{{ item.dest }}"
become: True
become_user: "{{ prometheus_user }}"