Remove the ntp package when we do not want it.

This commit is contained in:
Andrea Dell'Amico 2024-08-01 13:28:14 +02:00
parent de6e4f7b2e
commit c29608f849
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 8 additions and 4 deletions

View File

@ -11,8 +11,10 @@
service: name=ntp state=started enabled=yes service: name=ntp state=started enabled=yes
when: ntp_service_enabled | bool when: ntp_service_enabled | bool
- name: Ensure that the ntp server is stopped and disabled - name: Ensure that the ntp package is not installed
service: name=ntp state=stopped enabled=no ansible.builtin.apt:
pkg: ntp
state: absent
when: not ntp_service_enabled | bool when: not ntp_service_enabled | bool
when: when:
@ -32,8 +34,10 @@
service: name=ntpd state=started enabled=yes service: name=ntpd state=started enabled=yes
when: ntp_service_enabled | bool when: ntp_service_enabled | bool
- name: Ensure that the ntpd server is stopped and disabled - name: Ensure that the ntpd package is absent when not required
service: name=ntpd state=stopped enabled=no ansible.builtin.yum:
pkg: ntp
state: present
when: not ntp_service_enabled | bool when: not ntp_service_enabled | bool
- name: Manage the ntp firewalld rules in the {{ firewalld_default_zone }} zone - name: Manage the ntp firewalld rules in the {{ firewalld_default_zone }} zone