- 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)
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)
- 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:
- 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
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
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
- 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"