library/roles/postgresql: Set the postgresql port.

This commit is contained in:
Andrea Dell'Amico 2016-03-07 19:18:46 +01:00
parent 123af8c4ea
commit cf9dde6727
4 changed files with 16 additions and 12 deletions

View File

@ -59,6 +59,10 @@ postgresql_pgpool_pkgs:
pgpool_pkgs:
- pgpool2
pgpool_pcp_user: admin
# Define pcp_pwd in a vault file
# postgis
postgres_install_gis_extensions: False
postgres_gis_version: 2.1

View File

@ -17,6 +17,11 @@
notify: Reload postgresql
tags: [ 'postgresql', 'postgres', 'pg_hba' ]
- name: Set the postgresql listen port
action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key=port value="{{ psql_db_port }}"
notify: Restart postgresql
tags: [ 'postgresql', 'postgres', 'pg_conf' ]
- name: We want postgres listen on the public IP
action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key=listen_addresses value="'*'"
notify: Restart postgresql

View File

@ -4,3 +4,7 @@
with_items: '{{ pgpool_pkgs }}'
tags: [ 'postgresql', 'postgres', 'pgpool' ]
- name: Configure pcp
template: src=pcp.conf.j2 dest=/etc/pgpool2/pcp.conf owner=root group=postgres mode=0640
tags: [ 'postgresql', 'postgres', 'pgpool', 'pcp_conf' ]

View File

@ -2,27 +2,18 @@
- 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
tags:
- postgresql
- postgres
- pg_conf
tags: [ 'postgresql', 'postgres', 'pg_conf' ]
- 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
tags:
- postgresql
- postgres
- pg_conf
tags: [ 'postgresql', 'postgres', 'pg_conf' ]
- name: Set some postgresql configuration parameters
action: configfile path=/etc/postgresql/{{ psql_version }}/main/postgresql.conf key={{ item.name }} value="{{ item.value }}"
with_items: '{{ psql_conf_parameters }}'
when: item.set == 'True'
notify: Restart postgresql
tags:
- postgresql
- postgres
- pg_conf
tags: [ 'postgresql', 'postgres', 'pg_conf' ]