library/roles/postgresql: Various fixes for some complex cases.

This commit is contained in:
Andrea Dell'Amico 2017-03-07 13:12:36 +01:00
parent 892a05256a
commit f8254e1a82
3 changed files with 6 additions and 1 deletions

View File

@ -28,7 +28,6 @@
- include: postgresql-backup.yml - include: postgresql-backup.yml
when: when:
- psql_postgresql_install - psql_postgresql_install
- psql_db_data is defined
- include: pgpool-ii.yml - include: pgpool-ii.yml
when: psql_pgpool_service_install when: psql_pgpool_service_install
- include: postgresql-letsencrypt-acmetool.yml - include: postgresql-letsencrypt-acmetool.yml

View File

@ -5,12 +5,16 @@
tags: [ 'postgresql', 'postgres', 'pg_conf' ] tags: [ 'postgresql', 'postgres', 'pg_conf' ]
- name: Set the postgresql data dir if it is different from the default - name: Set the postgresql data dir if it is different from the default
become: True
become_user: postgres
action: configfile path={{ psql_conf_dir }}/postgresql.conf key=data_directory value="'{{ psql_data_dir }}'" action: configfile path={{ psql_conf_dir }}/postgresql.conf key=data_directory value="'{{ psql_data_dir }}'"
notify: Restart postgresql notify: Restart postgresql
when: psql_use_alternate_data_dir when: psql_use_alternate_data_dir
tags: [ 'postgresql', 'postgres', 'pg_conf' ] tags: [ 'postgresql', 'postgres', 'pg_conf' ]
- name: Set some postgresql configuration parameters - name: Set some postgresql configuration parameters
become: True
become_user: postgres
action: configfile path={{ psql_conf_dir }}/postgresql.conf key={{ item.name }} value="{{ item.value }}" action: configfile path={{ psql_conf_dir }}/postgresql.conf key={{ item.name }} value="{{ item.value }}"
with_items: '{{ psql_conf_parameters }}' with_items: '{{ psql_conf_parameters }}'
when: item.set == 'True' when: item.set == 'True'

View File

@ -1,6 +1,8 @@
--- ---
- block: - block:
- name: Setup ssl in the postgresql configuration - name: Setup 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 }}'" action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key={{ item.name }} value="'{{ item.value }}'"
with_items: '{{ psql_conf_ssl_parameters }}' with_items: '{{ psql_conf_ssl_parameters }}'
notify: Restart postgresql notify: Restart postgresql