summaryrefslogtreecommitdiffstats
path: root/tasks/webmap.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/webmap.yml')
-rw-r--r--tasks/webmap.yml29
1 files changed, 16 insertions, 13 deletions
diff --git a/tasks/webmap.yml b/tasks/webmap.yml
index 6f32a27..1ff8ea3 100644
--- a/tasks/webmap.yml
+++ b/tasks/webmap.yml
@@ -253,21 +253,22 @@
create: false
notify: Reload PostgreSQL
-- name: Create 'postgis' PostgreSQL schema
+- name: Create PostgreSQL schemas
become: true
become_user: postgres
community.postgresql.postgresql_schema:
- name: postgis
login_db: webmap
+ name: "{{ item.name }}"
owner: postgres
+ comment: "{{ item.comment }}"
+ with_items: "{{ postgis_schemas }}"
-- name: Install 'postgis' PostgreSQL extension to the webmap database in the postgis schema
+- name: Install 'postgis' PostgreSQL extension to the webmap database
become: true
become_user: postgres
community.postgresql.postgresql_ext:
name: postgis
login_db: webmap
- schema: postgis
comment: Geographic objects support for PostgreSQL
- name: GRANT CONNECT ON DATABASE webmap TO webmap_import, webmap_guest
@@ -279,29 +280,29 @@
type: database
role: webmap_import,webmap_guest
-- name: GRANT USAGE ON SCHEMA postgis TO webmap_import, webmap_guest
+- name: GRANT USAGE ON SCHEMA * TO webmap_import, webmap_guest
become: true
become_user: postgres
community.postgresql.postgresql_privs:
login_db: webmap
privs: USAGE
type: schema
- obj: postgis
+ objs: "{{ (['public'] + (postgis_schemas | map(attribute='name'))) | join(',') }}"
role: webmap_import,webmap_guest
-# webmap-import should TRUNCATE existing output layers
-- name: REVOKE CREATE ON SCHEMA postgis FROM webmap_import
+# tooling should TRUNCATE existing output layers instead
+- name: REVOKE CREATE ON SCHEMA * FROM webmap_import
become: true
become_user: postgres
community.postgresql.postgresql_privs:
login_db: webmap
privs: CREATE
type: schema
- obj: postgis
+ objs: "{{ (['public'] + (postgis_schemas | map(attribute='name'))) | join(',') }}"
role: webmap_import
state: absent
-- name: GRANT SELECT ON TABLES IN SCHEMA postgis TO webmap_guest
+- name: GRANT SELECT ON TABLES IN SCHEMA * TO webmap_guest
become: true
become_user: postgres
community.postgresql.postgresql_privs:
@@ -309,10 +310,11 @@
privs: SELECT
type: table
obj: ALL_IN_SCHEMA
- schema: postgis
+ schema: "{{ item }}"
role: webmap_guest
+ with_items: "{{ ['public'] + (postgis_schemas | map(attribute='name')) }}"
-- name: GRANT USAGE, SELECT ON SEQUENCES IN SCHEMA postgis TO webmap_guest
+- name: GRANT USAGE, SELECT ON SEQUENCES IN SCHEMA * TO webmap_guest
become: true
become_user: postgres
community.postgresql.postgresql_privs:
@@ -320,8 +322,9 @@
privs: USAGE,SELECT
type: sequence
obj: ALL_IN_SCHEMA
- schema: postgis
+ schema: "{{ item }}"
role: webmap_guest
+ with_items: "{{ ['public'] + (postgis_schemas | map(attribute='name')) }}"
- name: Copy /usr/local/share/webmap/import.py
copy: src=webmap-tools/webmap-import