AtlasOfLivingAustralia / ala-install

Ansible playbooks for installing the ALA components
https://www.ala.org.au
Apache License 2.0
26 stars 52 forks source link

Error in pg_instance role enabling extensions #794

Closed vjrj closed 2 months ago

vjrj commented 3 months ago

Installing spatial I get this error:

TASK [pg_instance : enable extensions "['postgis', 'postgis_topology', 'uuid-ossp']" for "layersdb" - local] ************************************************************************************************************************************************************************************************************************************************
task path: /home/vjrj/proyectos/gbif/dev/ala-install/ansible/roles/pg_instance/tasks/main.yml:98

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_postgresql_ext_payload_unb9p1xp/ansible_postgresql_ext_payload.zip/ansible_collections/community/general/plugins/modules/postgresql_ext.py", line 344, in main
  File "/tmp/ansible_postgresql_ext_payload_unb9p1xp/ansible_postgresql_ext_payload.zip/ansible_collections/community/general/plugins/modules/postgresql_ext.py", line 289, in ext_get_versions
  File "/tmp/ansible_postgresql_ext_payload_unb9p1xp/ansible_postgresql_ext_payload.zip/ansible_collections/community/general/plugins/modules/postgresql_ext.py", line 292, in <listcomp>
  File "/usr/lib/python3.8/distutils/version.py", line 64, in __gt__
    c = self._cmp(other)
  File "/usr/lib/python3.8/distutils/version.py", line 337, in _cmp
    if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'
failed: [gbif-es-espacial-2024-1] (item=postgis) => {
    "ansible_loop_var": "item",
    "changed": false,
    "invocation": {
        "module_args": {
            "ca_cert": null,
            "cascade": false,
            "db": "layersdb",
            "ext": "postgis",
            "login_host": "",
            "login_password": "",
            "login_unix_socket": "",
            "login_user": "postgres",
            "name": "postgis",
            "port": 5432,
            "schema": null,
            "session_role": null,
            "ssl_mode": "prefer",
            "state": "present",
            "trust_input": true,
            "version": null
        }
    },
    "item": "postgis",
    "msg": "Database query failed: '<' not supported between instances of 'str' and 'int'"
}
redirecting (type: modules) ansible.builtin.postgresql_ext to community.general.postgresql_ext

Similar to this one that is solved in recent versions.

adam-collins commented 2 months ago

I'm going to guess this is due to a postgres version bump.

keithraven-nbn commented 2 months ago

I'm going to guess this is due to a postgres version bump.

I think it related to this issue in the ansible postgresql_ext module https://github.com/ansible-collections/community.general/issues/1095

vjrj commented 2 months ago

Yes it is (I added a link to a PR that solves that issue). Closing this as a fix is merged.