Add pools to servers
This commit is contained in:
parent
6ea3305c93
commit
3efbbd95c8
|
@ -1,10 +1,15 @@
|
|||
---
|
||||
timesync_daemon: "ntp"
|
||||
|
||||
timesync_default_servers:
|
||||
timesync_default_pools:
|
||||
- 0.de.pool.ntp.org
|
||||
- 1.de.pool.ntp.org
|
||||
- 2.de.pool.ntp.org
|
||||
- 3.de.pool.ntp.org
|
||||
|
||||
timesync_default_servers:
|
||||
- ptbtime1.ptb.de
|
||||
- ptbtime2.ptb.de
|
||||
- ptbtime3.ptb.de
|
||||
|
||||
|
||||
|
|
|
@ -7,13 +7,20 @@
|
|||
|
||||
- name: Include each network variables if there is no host variable
|
||||
include_vars: "vars/timesync_{{ ansible_default_ipv4.network }}.yml"
|
||||
when: ansible_default_ipv4 and timesync_servers is not defined
|
||||
when: ansible_default_ipv4 and (timesync_servers|default(False) == False and timesync_pools|default(False) == False)
|
||||
|
||||
|
||||
- name: Set NTP server for machines without default gateway
|
||||
- name: "Set NTP »pools« for machines without default gateway"
|
||||
set_fact:
|
||||
timesync_pools: "{{ timesync_default_pools }}"
|
||||
when: timesync_servers|default(False) == False and timesync_pools|default(False) == False
|
||||
|
||||
|
||||
- name: "Set NTP »server« for machines without default gateway"
|
||||
set_fact:
|
||||
timesync_servers: "{{ timesync_default_servers }}"
|
||||
when: timesync_servers is not defined
|
||||
when: timesync_servers|default(False) == False and timesync_pools|default(False) == False
|
||||
|
||||
|
||||
|
||||
- name: Include OS dependent variables
|
||||
|
|
|
@ -11,10 +11,13 @@ filegen loopstats file loopstats type day enable
|
|||
filegen peerstats file peerstats type day enable
|
||||
filegen clockstats file clockstats type day enable
|
||||
|
||||
# NTP server pool
|
||||
# NTP servers
|
||||
{% for server in timesync_servers|default(["pool.ntp.org"]) %}server {{ server }} iburst
|
||||
{% endfor %}
|
||||
|
||||
# NTP pools
|
||||
{% for pool in timesync_pools|default([]) %}pool {{ pool }} iburst
|
||||
{% endfor %}
|
||||
|
||||
# Access control configuration
|
||||
# By default, exchange time with everybody, but don't allow configuration.
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# See timesyncd.conf(5) for details.
|
||||
|
||||
[Time]
|
||||
NTP={{ timesync_servers|default([])|join(' ') }}
|
||||
NTP={{ timesync_pools|default([])|join(' ') }} {{ timesync_servers|default([])|join(' ') }}
|
||||
{% if timesync_servers_fallback|default([]) %}FallbackNTP={{ timesync_servers_fallback|join(' ') }}
|
||||
{% else %}#FallbackNTP=
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue