Supported ansible-core versions when installing collections
Latest developments
None that I know of.
This wasn’t discussed at CfgMgmtCamp 2026.
Original text
Right now ansible-galaxy collection install’s dependency resolver still does not consider requires_ansible from meta/runtime.yml when installing collections. requires_ansible does declare which ansible-core (or ansible-base 2.10 / Ansible 2.9) versions a collection supports.
While there is a runtime warning when using a collection with an ansible-core version it does not support, it would prevent a lot of unnecessary issues if ansible-galaxy collection install would - like any other good package manager - only install collections for an ansible-core version that are actually supported.
This is annoying for a user since when installing a collection on an older ansible-core version, you can easily install a collection that will not work with your ansible-core version.
This is also very annoying for collection maintainers and developers since right now, dropping support for an ansible-core version is a breaking change. If the package manager (ansible-galaxy) would consider requires_ansible, one could start dropping support for ansible-core versions in minor releases according to semantic versioning.
When compiling things yesterday I forgot about something that was mentioned regarding requires_ansible during CfgMgmtCamp: since for some reasons many certified collections use requires_ansible incorrectly (since ansible-lint for some reason insists that you must only list supported ansible-core versions there) having ansible-galaxy collection install considering this could be problematic.
(I never understood this ansible-lint rule, I always thought it was wrong to have it enabled by default, and it’s one of the first thing I always disable when using ansible-lint.)
@felixfontein Do you think changing this rule in Ansible Lint to be opt-in via enable_list would help with this issue? Obviously it wouldn’t fix the wider issue but it could help other collection maintainers in the future with this?
since for some reasons many certified collections use requires_ansible incorrectly
What do you mean by this exactly? I’m not quite following. Do you mean by this, they are specifying the most up to date Ansible Core version here instead of the minimum ansible core version their collection supports? And there is confusion around what requires_ansible actually means?
Yes, though I would rather remove it completely. I still don’t see any reason why that rule is there.
I think @nitzmahone mentioned something like that at CfgMgmtCamp, but I don’t remember what exactly he said.
The problem seems to be that apparently for some reason, that check got added to ansible-lint since someone decided that Supported (with capital S) collections must only support Supported ansible-core versions (why that check has to always run eludes me). That was the only reason I ever heard for that rule: because it is (or was) required for the RH certification process.
For that reason collections seem to unnecessarily restrict their requires_ansible string.