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
|
@ -1,3 +1,3 @@
|
||||||
---
|
---
|
||||||
ntp_servers:
|
timesyncd_ntp_servers:
|
||||||
- 'ntp.evolix.net'
|
- '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
|
- name: Install systemd-timesyncd package
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: systemd-timesyncd
|
name: systemd-timesyncd
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# {{ ansible_managed }}
|
# {{ ansible_managed }}
|
||||||
[Time]
|
[Time]
|
||||||
NTP="{{ ntp_servers | join(' ') }}"
|
NTP="{{ timesyncd_ntp_servers | join(' ') }}"
|
||||||
|
|
Loading…
Reference in a new issue