Fix the install check of the EL related tasks.

This commit is contained in:
Andrea Dell'Amico 2024-08-01 14:11:20 +02:00
parent 38bffed229
commit e1a7097a3d
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,9 @@
---
- name: ntp-el | Manage the NTP service in the EL distributions
when:
- ansible_distribution_major_version is version_compare('7', '<=')
- ntp_service_enabled
tags: [ 'packages', 'ntp' ]
block:
- name: ntp-el | Install the ntpd server on CentOS <= 7
yum: pkg=ntp state=present
@ -23,19 +27,14 @@
when: firewalld_enabled
tags: [ 'packages', 'ntp', 'firewall', 'iptables_rules' ]
when:
- ansible_distribution_major_version is version_compare('7', '<=')
- ntp_service_install
tags: [ 'packages', 'ntp' ]
- name: ntp-el | Manage the NTP service in the EL distributions
when:
- ansible_distribution_major_version is version_compare('8', '>=')
- ntp_service_enabled
tags: [ 'packages', 'ntp' ]
block:
- name: ntp-el |Install the Chrony server on CentOS >= 8
ansible.builtin.dnf:
pkg: chrony
state: present
when:
- ansible_distribution_major_version is version_compare('8', '>=')
- ntp_service_install
tags: [ 'packages', 'ntp' ]