diff options
| author | Guilhem Moulin <guilhem@fripost.org> | 2026-03-05 14:30:44 +0100 |
|---|---|---|
| committer | Guilhem Moulin <guilhem@fripost.org> | 2026-03-05 23:18:54 +0100 |
| commit | 4ad98953f1c5372bc21248c24b386b0fd915f019 (patch) | |
| tree | 62828dae11c00e4d85ad0e0963c6b421f510c4dc /tasks/webmap.yml | |
| parent | b18a7063b1c9ad0dd895e46f344dcb20c59d195e (diff) | |
Use PostgreSQL schemas to partition layers.
Cf. 4bb4d381f193f14260fc9f56679588d8e455dc93 in tools.
Diffstat (limited to 'tasks/webmap.yml')
| -rw-r--r-- | tasks/webmap.yml | 29 |
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 |
