2018-10-16 21:05:15 +00:00
|
|
|
---
|
|
|
|
- block:
|
2019-01-09 20:00:55 +00:00
|
|
|
- name: Create tls folder structure
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ postgres_user }}"
|
|
|
|
group: "{{ postgres_group }}"
|
|
|
|
recurse: True
|
2019-08-27 20:55:28 +00:00
|
|
|
loop:
|
2019-01-09 20:00:55 +00:00
|
|
|
- "{{ __postgres_tls_key_path | dirname }}"
|
|
|
|
- "{{ __postgres_tls_cert_path | dirname }}"
|
2018-10-16 21:05:15 +00:00
|
|
|
become: True
|
|
|
|
become_user: root
|
|
|
|
|
|
|
|
- block:
|
2019-06-10 13:20:25 +00:00
|
|
|
- name: Copy certs and private key
|
2019-01-09 20:00:55 +00:00
|
|
|
copy:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
2019-08-27 20:55:28 +00:00
|
|
|
loop:
|
2019-01-09 20:00:55 +00:00
|
|
|
- { 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 }}"
|
2019-08-06 14:54:09 +00:00
|
|
|
notify: __postgres_reload
|
2018-10-16 21:05:15 +00:00
|
|
|
become: True
|
|
|
|
become_user: "{{ postgres_user }}"
|