Another attempt on fixing the install boolean.

This commit is contained in:
Andrea Dell'Amico 2024-08-01 14:07:23 +02:00
parent 49294d2f61
commit 38bffed229
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
---
ntp_service_install: '{% if ansible_distribution_version is version_compare("24.04", "<") %}true{% else %}false{% endif %}'
ntp_service_enabled: '{{ ntp_service_install }}'
ntp_service_enabled: '{{ ntp_service_install | bool }}'
ntp_statistics_enabled: false
ntp_allow_external_clients: false

View File

@ -1,7 +1,7 @@
---
- name: Display the value of ntp_service_install
ansible.builtin.debug:
msg: "ntp_service_install: {{ ntp_service_install }}"
msg: "ntp_service_install: {{ ntp_service_enabled }}"
tags: ntp
- name: Manage the NTP service in the Deb distributions

View File

@ -1,7 +1,7 @@
---
- name: ntp-deb | NTP server installation
tags: ['packages', 'ntp']
when: ntp_service_install
when: ntp_service_enabled
block:
- name: ntp-deb | Install the ntp server
apt: pkg=ntp state=present cache_valid_time=3600
@ -15,7 +15,7 @@
- name: ntp-deb | NTP server installation
tags: ['packages', 'ntp']
when: not ntp_service_install
when: not ntp_service_enabled
block:
- name: ntp-deb | Ensure that the ntp package is not installed
ansible.builtin.apt: