timesyncd: rename variable ntp_servers to timesyncd_ntp_servers and check for minimum number of elements
This commit is contained in:
parent
9c56cff642
commit
86e753b7a0
3 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
ntp_servers:
|
||||
- 'ntp.evolix.net'
|
||||
timesyncd_ntp_servers:
|
||||
- 'ntp.evolix.net'
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
---
|
||||
|
||||
- name: Verify that at least 1 NTP server is provided
|
||||
ansible.builtin.assert:
|
||||
that: timesyncd_ntp_servers | length > 0
|
||||
msg: The variable timesyncd_ntp_servers must contain at least 1 element
|
||||
|
||||
- name: Install systemd-timesyncd package
|
||||
ansible.builtin.apt:
|
||||
name: systemd-timesyncd
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# {{ ansible_managed }}
|
||||
[Time]
|
||||
NTP="{{ ntp_servers | join(' ') }}"
|
||||
NTP="{{ timesyncd_ntp_servers | join(' ') }}"
|
||||
|
|
Loading…
Reference in a new issue