RedHat 10 was released in May, and to address subtle differences between RedHat 9 and 10 I thought I could simply use the ‘lte’ construct for RedHat 9:-
when: (ansible_facts['distribution'] == 'RedHat' and ansible_facts['distribution_major_version'] <= '9') or
(ansible_facts['distribution'] == 'OracleLinux' and ansible_facts['distribution_major_version'] <= '9')
and for RedHat 10 use the following to differentiate:-
when: (ansible_facts['distribution'] == 'RedHat' and ansible_facts['distribution_major_version'] == '10') or
(ansible_facts['distribution'] == 'OracleLinux' and ansible_facts['distribution_major_version'] == '10')
however, the less than or equal to 9 is evaluating to true for my RedHat 10 deployments, so still tries to run the wrong code and consequently fails.
I wonder is this because the first character ‘1’ of ‘10’ is being evaluated as less than 9, whereas I expect this to evaluate to false. Probably wrong on that, but I’ve tried int without improving things.