Another attempt on fixing the install boolean.
This commit is contained in:
parent
49294d2f61
commit
38bffed229
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue