diff --git a/postgresql/defaults/main.yml b/postgresql/defaults/main.yml index 01ddd571..0b901f63 100644 --- a/postgresql/defaults/main.yml +++ b/postgresql/defaults/main.yml @@ -3,8 +3,10 @@ pg_use_postgresql_org_repo: True psql_postgresql_install: True +psql_pkg_state: installed postgresql_enabled: True psql_pgpool_install: False +psql_pgpool_pkg_state: installed # 9.3 is the default version for Ubuntu trusty # It is highly recommended to use the postgresql.org repositories # diff --git a/postgresql/tasks/packages.yml b/postgresql/tasks/packages.yml index b3c89d4d..bbe26d44 100644 --- a/postgresql/tasks/packages.yml +++ b/postgresql/tasks/packages.yml @@ -1,12 +1,12 @@ --- - name: install the postgresql packages - apt: pkg={{ item }} state=installed + 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=installed + apt: pkg={{ item }} state={{ psql_pkg_state }} with_items: - python-psycopg2 tags: [ 'postgresql', 'postgres' ] diff --git a/postgresql/tasks/pgpool-ii.yml b/postgresql/tasks/pgpool-ii.yml index ce042be2..c616e485 100644 --- a/postgresql/tasks/pgpool-ii.yml +++ b/postgresql/tasks/pgpool-ii.yml @@ -1,6 +1,6 @@ --- - name: Install the pgpool package - apt: name={{ item }} state=installed + apt: name={{ item }} state={{ psql_pgpool_pkg_state }} with_items: '{{ pgpool_pkgs }}' tags: [ 'postgresql', 'pgpool' ]