From 3f7e05bdf09952c0ef004cd7fb394180bc80d1fb Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 26 Mar 2019 17:42:22 +0100 Subject: [PATCH] postgres: fix the apt tasks. --- postgresql/tasks/packages.yml | 17 ++++++++--------- postgresql/tasks/pgpool-ii.yml | 6 ++---- postgresql/tasks/postgis.yml | 3 +-- postgresql/tasks/postgres_pgpool.yml | 3 +-- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/postgresql/tasks/packages.yml b/postgresql/tasks/packages.yml index cc61f11..604f93e 100644 --- a/postgresql/tasks/packages.yml +++ b/postgresql/tasks/packages.yml @@ -1,12 +1,11 @@ --- -- name: install the postgresql packages - apt: pkg={{ item }} state={{ psql_pkg_state }} - with_items: '{{ postgresql_pkgs }}' - notify: Restart postgresql - tags: [ 'postgresql', 'postgres' ] - -- name: Install the packages that ansible needs to manage the postgresql users and databases - apt: pkg={{ item }} state={{ psql_pkg_state }} - with_items: '{{ psql_ansible_needed_pkgs }}' +- block: + - name: Install the packages that ansible needs to manage the postgresql users and databases + apt: pkg={{ psql_ansible_needed_pkgs }} state={{ psql_pkg_state }} + + - name: install the postgresql packages + apt: pkg={{ postgresql_pkgs }} state={{ psql_pkg_state }} + notify: Restart postgresql + tags: [ 'postgresql', 'postgres' ] diff --git a/postgresql/tasks/pgpool-ii.yml b/postgresql/tasks/pgpool-ii.yml index 90f988d..b6e31f5 100644 --- a/postgresql/tasks/pgpool-ii.yml +++ b/postgresql/tasks/pgpool-ii.yml @@ -1,8 +1,7 @@ --- - block: - name: Install the pgpool package - apt: name={{ item }} state={{ psql_pgpool_pkg_state }} - with_items: '{{ pgpool_pkgs }}' + apt: name={{ pgpool_pkgs }} state={{ psql_pgpool_pkg_state }} cache_valid_time=1800 - name: Configure pcp #template: src=pcp.conf.j2 dest=/etc/pgpool2/pcp.conf owner=root group=postgres mode=0640 @@ -59,8 +58,7 @@ service: name=pgpool2 state=stopped enabled=no - name: Install the pgpool packages - apt: name={{ item }} state=absent - with_items: '{{ pgpool_pkgs }}' + apt: name={{ pgpool_pkgs }} state=absent - name: Remove the pgpool failover sudoers file file: dest=/etc/sudoers.d/pgpool-wd state=absent diff --git a/postgresql/tasks/postgis.yml b/postgresql/tasks/postgis.yml index 6c432f6..55f1168 100644 --- a/postgresql/tasks/postgis.yml +++ b/postgresql/tasks/postgis.yml @@ -1,7 +1,6 @@ --- - name: install the postgresql GIS packages - apt: pkg={{ item }} state={{ psql_pkg_state }} - with_items: '{{ postgres_gis_pkgs }}' + apt: pkg={{ postgres_gis_pkgs }} state={{ psql_pkg_state }} notify: Restart postgresql tags: [ 'postgresql', 'postgres', 'postgis' ] diff --git a/postgresql/tasks/postgres_pgpool.yml b/postgresql/tasks/postgres_pgpool.yml index 8e79cc4..21f9cba 100644 --- a/postgresql/tasks/postgres_pgpool.yml +++ b/postgresql/tasks/postgres_pgpool.yml @@ -1,7 +1,6 @@ --- - 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 }}' + apt: pkg={{ postgresql_pgpool_pkgs }} state={{ psql_pkg_state }} when: psql_pgpool_install notify: Restart postgresql tags: [ 'postgresql', 'postgres', 'pgpool' ]