From 38bffed2293066da067846e8d757d758c8a7993b Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 1 Aug 2024 14:07:23 +0200 Subject: [PATCH] Another attempt on fixing the install boolean. --- defaults/main.yml | 2 +- tasks/main.yml | 2 +- tasks/ntp-deb.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3e132fb..b7acb34 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 0e2171b..478797e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/ntp-deb.yml b/tasks/ntp-deb.yml index 6e911f8..b60ef56 100644 --- a/tasks/ntp-deb.yml +++ b/tasks/ntp-deb.yml @@ -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: