On Tuesday, September 14, 2021 at 7:20:59 PM UTC-4 Andy Smith wrote:
> My ansible_distribution_version returns "10". This debug fires:
>
> - name: version 10 < 10.0
> ansible.builtin.debug:
> msg:
> - "I think 10 is older than 10.0"
> when: {{ ansible_distribution_version }} is version('10.0', '<')
>
> python 3.9.7, ansible 2.10.14.
>
> Any way around this without processing ansible_distribution_version
> to have a trailing ".0" when it has no dots?
>
Yes. Compare to the lowest version you want to accept, which is '10'.
(Also, don't nest moustaches.)
when: ansible_facts.distribution_version is version('10', '<')
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/c7e2d9f1-428e-4f3c-a315-dc47473b8756n%40googlegroups.com.