diff --git a/README.md b/README.md index 4e633aa7..0d512a35 100644 --- a/README.md +++ b/README.md @@ -353,6 +353,8 @@ Below are listed all the variables you can customize (you may also want to take host: "" port: "" options: {} + # SPATIALITE_LIBRARY_PATH django setting + openwisp2_spatialite_path: "mod_spatialite" # customize other django settings: openwisp2_language_code: en-gb openwisp2_time_zone: UTC diff --git a/defaults/main.yml b/defaults/main.yml index 7498f821..ff41f838 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,6 +20,7 @@ openwisp2_database: host: "" port: "" options: {} +openwisp2_spatialite_path: "mod_spatialite" openwisp2_language_code: "en-gb" openwisp2_time_zone: "UTC" openwisp2_context: {} diff --git a/tasks/apt.yml b/tasks/apt.yml index 68d04fa3..8718cfcf 100644 --- a/tasks/apt.yml +++ b/tasks/apt.yml @@ -27,6 +27,7 @@ - libproj-dev - libgeos-dev - libspatialite-dev + - libsqlite3-mod-spatialite # fixes issue described in https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user - name: Install acl if acting as non-root user diff --git a/templates/openwisp2/settings.py b/templates/openwisp2/settings.py index b3ac126d..5950f6e9 100644 --- a/templates/openwisp2/settings.py +++ b/templates/openwisp2/settings.py @@ -128,6 +128,8 @@ # Database # https://docs.djangoproject.com/en/1.9/ref/settings/#databases +SPATIALITE_LIBRARY_PATH = '{{ openwisp2_spatialite_path }}' + DATABASES = { 'default': { 'ENGINE': '{{ openwisp2_database.engine }}',