2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: Create the postgresql data directory if it is not in the default place
|
|
|
|
file: dest={{ psql_data_dir }} owner=postgres group=postgres mode=700 recurse=yes state=directory
|
|
|
|
when: psql_use_alternate_data_dir
|
2016-03-07 19:18:46 +01:00
|
|
|
tags: [ 'postgresql', 'postgres', 'pg_conf' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Set the postgresql data dir if it is different from the default
|
|
|
|
action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key=data_directory value="'{{ psql_data_dir }}'"
|
|
|
|
notify: Restart postgresql
|
|
|
|
when: psql_use_alternate_data_dir
|
2016-03-07 19:18:46 +01:00
|
|
|
tags: [ 'postgresql', 'postgres', 'pg_conf' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Set some postgresql configuration parameters
|
|
|
|
action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key={{ item.name }} value="{{ item.value }}"
|
2016-03-02 16:44:43 +01:00
|
|
|
with_items: '{{ psql_conf_parameters }}'
|
2015-05-28 11:32:57 +02:00
|
|
|
when: item.set == 'True'
|
|
|
|
notify: Restart postgresql
|
2016-03-07 19:18:46 +01:00
|
|
|
tags: [ 'postgresql', 'postgres', 'pg_conf' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|