# Version warnings wrt Collections vs. Ansible

**URL:** <https://forum.ansible.com/t/version-warnings-wrt-collections-vs-ansible/3511>\
**Category:** Project Discussions\
**Tags:** vmware, playbook, collections\
**Created:** [January 29, 2024, 2:28pm UTC](https://forum.ansible.com/t/version-warnings-wrt-collections-vs-ansible/3511 "2024-01-29T14:28:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 29, 2024, 2:28pm UTC](https://forum.ansible.com/t/version-warnings-wrt-collections-vs-ansible/3511/1 "2024-01-29T14:28:06Z")

</div>

I’ve been studiously ignoring recent messages like this one:

```auto
[WARNING]: Collection community.vmware does not support Ansible version 2.14.7

```

until a couple of days ago, thinking that the older `community.vmware` collection that was getting pulled in was a bit long in the tooth and needed upgrading.

Then I changed the relevant `collections/requirements.yml` to pull in the latest `community.vmware` to address the problem, and I still got the same message. It wasn’t until then that I realized how ambiguous that message is.

It isn’t because the _collection_ is to old. It’s because my _Ansible_ is too old. D’oh!

A much better message would be:

```auto
[WARNING]: Collection A.B version I.J.K requires Ansible version L.M.N or higher

```

or maybe

```auto
[WARNING]: Collection A.B version I.J.K does not support Ansible versions below L.M.N

```

either of which would tell the user what the issue is rather than merely stating that there’s an issue relating to versions.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [January 29, 2024, 4:40pm UTC](https://forum.ansible.com/t/version-warnings-wrt-collections-vs-ansible/3511/2 "2024-01-29T16:40:19Z")

</div>

You should open a github issue with the collection.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 29, 2024, 5:10pm UTC](https://forum.ansible.com/t/version-warnings-wrt-collections-vs-ansible/3511/3 "2024-01-29T17:10:42Z")

</div>

The message is coming from `ansible/plugins/loader.py`.

```auto
(venv-python39-ansible-core-214) [utoddl@ssh site-packages]$ pwd
/opt/venv-python39-ansible-core-214/lib/python3.9/site-packages
(venv-python39-ansible-core-214) [utoddl@ssh site-packages]$ grep -rn 'does not support Ansible version' .
./ansible/plugins/loader.py:1425: message = 'Collection {0} does not support Ansible version {1}'.format(collection_name, ansible_version)

```

Ah, I should raise the issue in [Issues · ansible/ansible · GitHub](https://github.com/ansible/ansible/issues). I erroneously thought it was one of the project that didn’t have issues any more. Mondays, right?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 29, 2024, 5:50pm UTC](https://forum.ansible.com/t/version-warnings-wrt-collections-vs-ansible/3511/4 "2024-01-29T17:50:38Z")

</div>

> [@utoddl](#):
>
> A much better message would be:
> 
> ```auto
> [WARNING]: Collection A.B version I.J.K requires Ansible version L.M.N or higher
> 
> ```
> 
> or maybe
> 
> ```auto
> [WARNING]: Collection A.B version I.J.K does not support Ansible versions below L.M.N
> 
> ```
> 
> either of which would tell the user what the issue is rather than merely stating that there’s an issue relating to versions.

The problems with these messages is that they only work if `requires_ansible` in the collection’s `meta/runtime.yml` is of the form `>=L.M.N`, while that string can be a lot more complex (for example `>1.2.3,<4.0.0-a,!=2.0.1,!=2.1.3,!=3.1.5,!=5.0.0`).

Though having a special case for `>=L.M.N`, and printing the whole requirements string if it’s not of that form with a different message (like `Collection A.B version I.J.K does not support Ansible version L.M.N; this version of the collection needs Ansible version <version-string-here>`).
