Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion osmosis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- name: osmosis configuration
hosts: osmosis
gather_facts: no
become: yes
roles:
- osmosis
14 changes: 10 additions & 4 deletions roles/osmosis/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@
postgis_version: 2.5
when: ansible_distribution_release == "buster"

- name: set postgresql_version = 17
set_fact:
postgresql_version: 17
postgis_version: 3.5
when: ansible_distribution_release == "bookworm"

- name: install packages
apt: pkg={{ item }}
with_items:
- osmosis
- postgresql
- postgis
- postgresql-contrib
- python-psycopg2
- python3-psycopg2
- default-jre-headless

- name: ensure postgresql server is running
Expand Down Expand Up @@ -46,10 +52,10 @@
become: yes
become_user: postgres

- name: psql extension hstore
- name: psql extensions
command: psql -d osm -c "CREATE EXTENSION IF NOT EXISTS {{ item }}"
register: psql_res
changed_when: "not 'extension \"{{ item }}\" already exists' in '{{ psql_res.stderr }}'"
changed_when: "not 'extension \"item | string\" already exists' in psql_res.stderr | string"
become: yes
become_user: postgres
with_items:
Expand All @@ -74,7 +80,7 @@
- name: psql check schema osmosis
command: psql -t -d osm -c "SELECT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'osmosis');"
register: check_schema
changed_when: "'f' in '{{ check_schema.stdout }}'"
changed_when: "'f' in check_schema.stdout | string"
become: yes
become_user: postgres

Expand Down
Loading