-1

Trying to install ansible-tower 1.2.1-1 on centos 8 stream and I am receiving this error. Are there any suggestions on how to get around it?

TASK [group hosts for supported distributions] ***************************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"msg": "The conditional check 'ansible_distribution_version is version_compare ('7.7', '>=')' failed. The error was: Version comparison: '<' not supported between instances of 'str' and 'int'\n\nThe error appears to be in '/home/username/ansible-automation-platform-setup-bundle-1.2.1-1/install.yml': line 40, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: group hosts for supported distributions\n ^ here\n"}

1 Answers1

2

As the message plainly indicates, the types don't match and the version_compare test is not expected to be used for int values, that's what the normal comparison operators are for

The solution is either to use the original, unmodified, ansible_distribution_version fact, or (unlikely) manually cast it to a string:

- debug:
    msg: is greater than 7.7: {{ ansible_distribution_version|string is version_compare ('7.7', '>=')' }}

You may get some benefit from examining what, exactly, is in that fact and compare it to what is in the fact at the beginning of your playbook to guess where it went off the rails

tasks:
- name: show the value at the beginning
  debug: var=ansible_distribution_version

... other ...

- name: show the value before running that "is version_compare"
  debug: var=ansible_distribution_version
mdaniel
  • 31,240
  • 5
  • 55
  • 58
  • Thank you for the tip, I was able to ultimately resolve this by commenting out the task which changed the ansible_distribution_version variable into a value which wasn't compatible with the subsequent tasks. I want to say that I'm surprised that RH would be shipping software that doesn't work, but, I'm not. – detroitdude Jun 28 '21 at 22:26