From a02043382f84289f862cfb5056f295dbc90123e5 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 4 Mar 2016 12:58:49 +0100 Subject: [PATCH] library/roles/postgresql: pgpool needs some parts installed on the postgresql server. --- postgresql/defaults/main.yml | 5 ++++- postgresql/tasks/packages.yml | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/postgresql/defaults/main.yml b/postgresql/defaults/main.yml index 2af02923..d2cc14a6 100644 --- a/postgresql/defaults/main.yml +++ b/postgresql/defaults/main.yml @@ -48,9 +48,12 @@ psql_db_name: db_name psql_db_user: db_user psql_db_pwd: "We cannot save the password into the repository. Use another variable and change pgpass.j2 accordingly. Encrypt the file that contains the variable with ansible-vault" +# Those need to be installed on the postgresql server. +postgresql_pgpool_pkgs: + - 'postgresql-{{ psql_version }}-pgpool2' + # pgpool-II pgpool_pkgs: - - 'postgresql-{{ psql_version }}-pgpool2' - pgpool2 # postgis diff --git a/postgresql/tasks/packages.yml b/postgresql/tasks/packages.yml index bbe26d44..9946ea82 100644 --- a/postgresql/tasks/packages.yml +++ b/postgresql/tasks/packages.yml @@ -11,6 +11,12 @@ - python-psycopg2 tags: [ 'postgresql', 'postgres' ] +- name: Install the packages needed by postgres when running behind a pgpool server + apt: pkg={{ item }} state={{ psql_pkg_state }} + with_items: '{{ postgresql_pgpool_pkgs }}' + when: psql_pgpool_install + tags: [ 'postgresql', 'postgres', 'pgpool' ] + - name: Ensure that the postgresql server is started service: name=postgresql state=started enabled=yes when: postgresql_enabled