I'm not even sure if '10' and '10.0' are actually different in terms
of one being higher or lower than the other.
I'd be interested to know what the rationale is for declaring 10
higher or lower than 10.0 (or the other way around).

BTW in our environment, the OSes where ansible_distribution_version is
defined, it always has one or more 'decimals', for example:

9.4 (debian 9)
10.10 (debian 10)
16.04 (ubuntu)
18.04 (ubuntu)
6.9 (centos6)
6.10 (rhel6)
7.5.1804 (centos7)
7.6 (rhel7)

Instead of trying to make (to me rather arbitrary) comparisons between
10 and 10.0, I'd investigate why ansible_distribution_version for your
OS has no 'decimals' to begin with.




On Wed, 15 Sept 2021 at 10:11, Andy Smith <[email protected]> wrote:
>
> Hello,
>
> On Tue, Sep 14, 2021 at 05:49:44PM -0700, flowerysong wrote:
> > 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', '<')
>
> > Yes. Compare to the lowest version you want to accept, which is '10'.
>
> Hmm, OK. It's also that 10 won't come out as >= 10.0 so I'll have to
> remember everywhere not to compare to versions with .0 on the end.
>
> Cheers,
> Andy
>
> --
> 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/20210915081128.r2l2drg57m7wv4w5%40bitfolk.com.
>


-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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/CAL8fbwMNvyZr1syAe7f1HkXRNDD31oamK9RAc1Yb2wb9QOyZOw%40mail.gmail.com.

Reply via email to