xoxys.postgres/tasks/tls.yml
2019-06-10 15:20:25 +02:00

29 lines
860 B
YAML

---
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
owner: "{{ postgres_user }}"
group: "{{ postgres_group }}"
recurse: True
with_items:
- "{{ __postgres_tls_key_path | dirname }}"
- "{{ __postgres_tls_cert_path | dirname }}"
become: True
become_user: root
- block:
- name: Copy certs and private key
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: "{{ postgres_tls_key_source }}", dest: '{{ __postgres_tls_key_path }}', mode: '0600' }
- { src: "{{ postgres_tls_cert_source }}", dest: '{{ __postgres_tls_cert_path }}', mode: '0750' }
loop_control:
label: "{{ item.dest }}"
become: True
become_user: "{{ postgres_user }}"