Closed joek-office closed 5 months ago
This is a know issue in Ansible, forwarding @richm investigations on this issue
https://github.com/ansible/galaxy_ng/pull/1946
It's because
main
(ormaster
) is listed in theversions
field, sorole install
thinksmain
is a semantic version, and it fails to sort."the current code didn't truly understand how the role versions worked and tried to cram the concept of master/main/etc into a version"
The Galaxy team are aware of the problem and actively working on it.
They also suggested that it was possible to install roles by specifying the version - I can get it to work with a roles file:
roles:
- name: linux-system-roles.systemd version: 1.0.2
then ansible-galaxy role install -vv -r roles.yml
What happened: command: ansible-galaxy role install linux-system-roles.firewall linux-system-roles.kernel_settings
[WARNING]: - linux-system-roles.firewall was NOT installed successfully: Unable to compare role versions (0.1, 0.1.0, 0.1.1, 0.2.0, 0.2.1, 0.3.0, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 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. Starting galaxy role install process
What you expected to happen: no error and role installed
How to reproduce it (as minimally and precisely as possible): i think it is a major problem that is easy to reproduce with running command: ansible-galaxy role install linux-system-roles.firewall
Anything else we need to know?: have tested in my automated environment (gitlab ci) and locally
Environment: like i mentioned the error comes on local command line and on an gitlab ci that was building a docker image that includes the role.