2016-06-21 19:58:26 +02:00
|
|
|
---
|
2016-10-20 17:10:17 +02:00
|
|
|
- block:
|
2017-11-21 18:06:23 +01:00
|
|
|
- name: Setup SSL in the postgresql configuration
|
2017-03-07 13:12:36 +01:00
|
|
|
become: True
|
|
|
|
become_user: postgres
|
2016-10-20 17:10:17 +02:00
|
|
|
action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key={{ item.name }} value="'{{ item.value }}'"
|
|
|
|
with_items: '{{ psql_conf_ssl_parameters }}'
|
|
|
|
notify: Restart postgresql
|
|
|
|
|
|
|
|
- name: Create the pki directory to store the postgresql key
|
|
|
|
file: dest=/etc/pki/postgresql state=directory owner=postgres group=postgres mode=0750
|
|
|
|
|
|
|
|
- name: Create a postgres accessible ssl key file if it does not exist
|
2017-11-21 18:06:23 +01:00
|
|
|
copy: src={{ psql_ssl_privkey_global_file }} dest={{ psql_ssl_privkey_file }} owner=postgres group=postgres mode=0400 remote_src=True
|
2016-10-20 17:10:17 +02:00
|
|
|
|
2016-06-21 19:58:26 +02:00
|
|
|
when: psql_enable_ssl
|
2017-11-21 18:06:23 +01:00
|
|
|
tags: [ 'postgresql', 'postgres', 'pg_ssl_conf', 'pg_conf' ]
|
|
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Disable SSL in the postgresql configuration
|
|
|
|
become: True
|
|
|
|
become_user: postgres
|
|
|
|
action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key={{ item.name }} value="'{{ item.value }}'"
|
|
|
|
with_items: '{{ psql_conf_disable_ssl_parameters }}'
|
|
|
|
notify: Restart postgresql
|
|
|
|
|
|
|
|
when: not psql_enable_ssl
|
|
|
|
tags: [ 'postgresql', 'postgres', 'pg_ssl_conf', 'pg_conf' ]
|