Hi gang, Using the ansible playbook to deploy OpenWISP2 is perfectly fine. Customizing the playbook to deploy OpenWISP2 with a PostgreSQL backend leads me to the error *AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'*
I got some info from: https://stackoverflow.com/questions/12538510/getting-databaseoperations-object-has-no-attribute-geo-db-type-error-when-do and I understand that the error comes from departing from default settings in the OpenWISP2 playbook: engine: "django.contrib.gis.db.backends.spatialite" name: "{{ openwisp2_path }}/db.sqlite3" user: "" password: "" host: "" port: "" options: {} openwisp2_database: Any idea how to solve this? Thanks a lot for your help! Best, unracer *Current playbook and the error received in ansible* ##playbook.yml - hosts: openwisp2 become: "{{ become | default('yes') }}" roles: - openwisp.openwisp2 vars: openwisp2_default_from_email: "[email protected]" openwisp2_database: engine: django.db.backends.postgresql name: openwisp2 user: openwisp2 password: "mypassword" host: "psql01.mydomain.org" port: "5432" options: {} ##ansible error received fatal: [openwisp201.mydomain.org]: FAILED! => {"changed": false, "cmd": "./manage.py migrate --noinput", "msg": "stdout: Operations to perform:\n App ly all migrations: account, admin, auth, config, contenttypes, geo, openwisp_users, pki, reversion, sessions, sites, socialaccount\nRunning migrations :\n Applying geo.0001_initial...\n:stderr: Traceback (most recent call last):\n File \"./manage.py\", line 10, in <module>\n execute_from_command _line(sys.argv)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/core/management/__init__.py\", line 371, in execute_from_command_line\ n utility.execute()\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/core/management/__init__.py\", line 365, in execute\n self.f etch_command(subcommand).run_from_argv(self.argv)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/core/management/base.py\", line 288, in run_from_argv\n self.execute(*args, **cmd_options)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/core/management/base.py\", l ine 335, in execute\n output = self.handle(*args, **options)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/core/management/comman ds/migrate.py\", line 200, in handle\n fake_initial=fake_initial,\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/db/migrations/exe cutor.py\", line 117, in migrate\n state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)\n File \"/opt/ openwisp2/env/lib/python3.6/site-packages/django/db/migrations/executor.py\", line 147, in _migrate_all_forwards\n state = self.apply_migration(sta te, migration, fake=fake, fake_initial=fake_initial)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/db/migrations/executor.py\", line 244, in apply_migration\n state = migration.apply(state, schema_editor)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/db/migrati ons/migration.py\", line 122, in apply\n operation.database_forwards(self.app_label, schema_editor, old_state, project_state)\n File \"/opt/openwi sp2/env/lib/python3.6/site-packages/django/db/migrations/operations/models.py\", line 92, in database_forwards\n schema_editor.create_model(model)\ n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/db/backends/base/schema.py\", line 265, in create_model\n definition, extra_params = self.column_sql(model, field)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/db/backends/base/schema.py\", line 157, in column_sql\ n db_params = field.db_parameters(connection=self.connection)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/db/models/fields/__in it__.py\", line 673, in db_parameters\n type_string = self.db_type(connection)\n File \"/opt/openwisp2/env/lib/python3.6/site-packages/django/cont rib/gis/db/models/fields.py\", line 105, in db_type\n return connection.ops.geo_db_type(self)\n *AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'\*n", "path": "/opt/openwisp2/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin", "state": "absent", "syspath": ["/tmp/ansible_django_manage_payload_U1csLu/ansible_django_manage_payload.zip", "/usr/lib/python2.7", "/usr/lib/python2.7/plat-x86_64-linu x-gnu", "/usr/lib/python2.7/lib-tk", "/usr/lib/python2.7/lib-old", "/usr/lib/python2.7/lib-dynload", "/usr/local/lib/python2.7/dist-packages", "/usr/l ib/python2.7/dist-packages"]} -- You received this message because you are subscribed to the Google Groups "OpenWISP" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/c51839ec-f96d-4a9f-b349-e0c0aabcf275%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
