diff --git a/postgresql/defaults/main.yml b/postgresql/defaults/main.yml index 739e7556..369c8101 100644 --- a/postgresql/defaults/main.yml +++ b/postgresql/defaults/main.yml @@ -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 diff --git a/postgresql/tasks/configure-access.yml b/postgresql/tasks/configure-access.yml index 3a6e6d23..d17ee07b 100644 --- a/postgresql/tasks/configure-access.yml +++ b/postgresql/tasks/configure-access.yml @@ -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 diff --git a/postgresql/tasks/pgpool-ii.yml b/postgresql/tasks/pgpool-ii.yml index 1d4bd7cb..bac57712 100644 --- a/postgresql/tasks/pgpool-ii.yml +++ b/postgresql/tasks/pgpool-ii.yml @@ -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' ] + diff --git a/postgresql/tasks/postgresql-config.yml b/postgresql/tasks/postgresql-config.yml index be4a7aa6..b16ad51c 100644 --- a/postgresql/tasks/postgresql-config.yml +++ b/postgresql/tasks/postgresql-config.yml @@ -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' ]