]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Fix distro version comparison conditionals 427/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 4 Dec 2018 17:56:29 +0000 (12:56 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 4 Dec 2018 17:56:29 +0000 (12:56 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/common/tasks/nagios.yml
roles/common/tasks/yum_systems.yml
roles/testnode/tasks/yum/packages.yml
tools/prep-fog-capture.yml

index 24f8e415cc2e572e5dbbeb3b23bb2c285461633d..e7a13e71cd328b15741d4e1464ebf6f33cf1c84c 100644 (file)
@@ -28,7 +28,7 @@
     - http://{{ mirror_host }}/lab-extras/rhel7/x86_64/nagios-plugins-load-2.0.3-3.el7.x86_64.rpm
   when:
     - ansible_os_family == "RedHat"
-    - ansible_distribution_major_version <= 7
+    - ansible_distribution_major_version|int <= 7
     - have_epel.rc == 1
 
 - name: Install nrpe package and dependencies (RHEL/CentOS)
@@ -39,7 +39,7 @@
   with_items: "{{ nrpe_packages }}"
   when:
     - ansible_os_family == "RedHat"
-    - ansible_distribution_major_version <= 7
+    - ansible_distribution_major_version|int <= 7
     - have_epel.rc == 0
 
 - name: Install nrpe package and dependencies (Ubuntu)
index 7128d79113257ecef584faa8bfae356c2d8605ec..521998cad9ec916876cbfd30a9ce46e75144b4aa 100644 (file)
@@ -9,7 +9,7 @@
 
 - name: Get the current timezone (RHEL/CentOS 7)
   shell: 'timedatectl | grep -E "Time ?zone" | sed -e "s/.*: \(.*\) (.*/\1/"'
-  when: ansible_distribution_major_version >= "7"
+  when: ansible_distribution_major_version|int >= 7
   register: current_tz
   changed_when: false
   tags:
@@ -29,7 +29,7 @@
 - name: Set the timezone (RHEL/CentOS >= 7)
   command: timedatectl set-timezone {{ timezone }}
   # Default is used below to avoid breaking check mode
-  when: ansible_distribution_major_version >= "7" and current_tz.stdout|default("") != timezone
+  when: ansible_distribution_major_version|int >= 7 and current_tz.stdout|default("") != timezone
   tags:
     - timezone
 
index 8b8eb93440b2c6978d34e6ad480af4c5d7b57026..c9136f3858525dbd11ba55315f6fa828bcf40f8f 100644 (file)
@@ -6,7 +6,7 @@
     state: present
   when:
     - ansible_os_family == "RedHat"
-    - ansible_distribution_major_version <= 7
+    - ansible_distribution_major_version|int <= 7
 
 - name: Removing saved yum transactions
   command: yum-complete-transaction --cleanup-only
@@ -14,7 +14,7 @@
   changed_when: "'Cleaning up' in transaction_cleanup.stdout"
   when:
     - ansible_os_family == "RedHat"
-    - ansible_distribution_major_version <= 7
+    - ansible_distribution_major_version|int <= 7
 
 - name: Check if ceph-debuginfo is installed
   command: rpm -q ceph-debuginfo
index 8e63dfadbbabdb4c18821f9d71b9f297279ae07c..e381dd0c7c0f830de8f6ac9299766c4db097f1c4 100644 (file)
 
   - set_fact:
       ntp_service: ntpd
-    when: ansible_os_family == "RedHat" and ansible_distribution_major_version <= 7
+    when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7
 
   - set_fact:
       ntp_service: chronyd
-    when: (ansible_os_family == "RedHat" and ansible_distribution_major_version >= 8) or
+    when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8) or
           ansible_os_family == "Suse"
 
   - name: "Stop {{ ntp_service }} service"