From fc5df1a3befa0607ba260dba60f2cb58a0ab60d1 Mon Sep 17 00:00:00 2001 From: calvinpy Date: Sun, 27 Jul 2014 16:59:40 +0200 Subject: [PATCH 1/2] postgis extension databases --- tasks/databases.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/databases.yml b/tasks/databases.yml index 4a10df36..09865487 100644 --- a/tasks/databases.yml +++ b/tasks/databases.yml @@ -29,3 +29,10 @@ shell: "psql {{item.name}} -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" with_items: postgresql_databases when: item.uuid_ossp is defined and item.uuid_ossp + +- name: PostgreSQL | Add postgis to the databases with the requirement + sudo: yes + sudo_user: "{{postgresql_admin_user}}" + shell: "psql {{item.name}} -c 'CREATE EXTENSION IF NOT EXISTS postgis;'&&psql {{item.name}} -c 'CREATE EXTENSION IF NOT EXISTS postgis_topology;'" + with_items: postgresql_databases + when: item.gis is defined and item.gis From 639d8411fcbfc06aac80ae4c665e6f62bfe1f7d7 Mon Sep 17 00:00:00 2001 From: calvinpy Date: Sun, 27 Jul 2014 17:09:08 +0200 Subject: [PATCH 2/2] add postgis scripts package --- tasks/extensions/postgis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/extensions/postgis.yml b/tasks/extensions/postgis.yml index a2b16eb8..38a369c2 100644 --- a/tasks/extensions/postgis.yml +++ b/tasks/extensions/postgis.yml @@ -7,5 +7,6 @@ with_items: - libgeos-c1 - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" + - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}-scripts" notify: - restart postgresql