Fix version comparison for PowerTools installation 05/63705/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 17 Apr 2020 21:42:42 +0000 (14:42 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Fri, 17 Apr 2020 21:42:42 +0000 (14:42 -0700)
Apparently ansible_distribution_major_version returns a string and
cannot therefore properly be tested in an integer based test. Use the
version() function instead.

https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html#version-comparison

Change-Id: I7abb42f94b1543aed5fe3ca548184ac1082612d7
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
provision/install-base-pkgs-RedHat.yaml

index 898b4e6..59a9b5d 100644 (file)
@@ -20,7 +20,7 @@
     cmd: dnf config-manager --set-enabled PowerTools
     warn: no
   become: true
-  when: ansible_distribution_major_version >= 8
+  when: ansible_facts['distribution_version'] is version('8', '>=')
 
 - name: Install base packages
   yum: