nginxinc / ansible-role-nginx

Ansible role for installing NGINX
https://galaxy.ansible.com/nginxinc/nginx
Apache License 2.0
619 stars 340 forks source link

Error when installing the role from Ansible Galaxy: Unable to compare role versions #666

Closed justas147 closed 8 months ago

justas147 commented 8 months ago

Describe the bug

I'm trying to install the role from Galaxy and get this error:

$ ansible-galaxy install nginxinc.nginx
[WARNING]: - nginxinc.nginx was NOT installed successfully: Unable to compare role versions (0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.8.0, 0.9.0, 0.10.0, 0.10.1, 0.11.0,
0.12.0, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.21.0, 0.21.1, 0.21.2, 0.21.3, 0.22.0, 0.23.0,
0.23.1, 0.23.2, 0.24.0, 0.24.1, main) to determine the most recent version due to incompatible version formats. Please contact the role author to resolve versioning conflicts, or specify
an explicit role version to install.
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
alessfg commented 8 months ago

The new Ansible Galaxy seems to be bugged out https://forum.ansible.com/t/role-import-from-github-results-in-master-release-not-the-tag-release-breaking-installs/1856. Not much I can do on my end until the Ansible Galaxy team fixes it on their end.

cyberpuffin-digital commented 8 months ago

My current bypass, courtesy of Geerlingguy's blog post on the topic and similar issue in the pip role, is to hard-code the version to install:

  - name: nginxinc.nginx
    src: https://github.com/nginxinc/ansible-role-nginx
    version: 0.24.1

I might need to start subscribing to a few more repo feeds (https://github.com/nginxinc/ansible-role-nginx/tags.atom) for updates until this is resolved.

alessfg commented 8 months ago

Thanks for the info! Glad to see there's a workaround for the time being 😊

justas147 commented 8 months ago

Thank you for a workaround! It looks like the issue is fixed from the Ansible Galaxy side. Install command returns without errors.

One note: it looks like the latest version (0.24.2) is not available at the moment. This comment mentions that the effected role versions are cleaned up during re-import.