-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add chrony, systemd-timesyncd tasks ✨
- Loading branch information
Showing
5 changed files
with
120 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# {{ ansible_managed }} | ||
|
||
driftfile {{ chrony_driftfile }} | ||
|
||
{% for server in chronyservers_preferred %} | ||
{% if server is search('pool') %} | ||
pool {{ server }} iburst prefer | ||
{% else %} | ||
server {{ server }} iburst prefer | ||
{% endif %} | ||
{% endfor %} | ||
{% for server in chronyservers %} | ||
{% if server is search('pool') %} | ||
pool {{ server }} iburst | ||
{% else %} | ||
server {{ server }} iburst | ||
{% endif %} | ||
{% endfor %} | ||
|
||
# Ignore stratum in source selection. | ||
stratumweight 0 | ||
|
||
# Record the rate at which the system clock gains/losses time. | ||
driftfile {{ chrony_driftfile }} | ||
|
||
# Enable kernel RTC synchronization. | ||
rtcsync | ||
|
||
# This directive tells 'chronyd' to parse the 'adjtime' file to find out if the | ||
# real-time clock keeps local time or UTC. It overrides the 'rtconutc' directive. | ||
hwclockfile /etc/adjtime | ||
|
||
# In first three updates step the system clock instead of slew | ||
# if the adjustment is larger than 10 seconds. | ||
makestep 10 3 | ||
|
||
# Stop bad estimates upsetting machine clock. | ||
maxupdateskew 100.0 | ||
|
||
# Allow NTP client access from local network. | ||
#allow 192.168/16 | ||
|
||
# Listen for commands only on localhost. | ||
bindcmdaddress 127.0.0.1 | ||
bindcmdaddress ::1 | ||
|
||
# Serve time even if not synchronized to any NTP server. | ||
#local stratum 10 | ||
|
||
keyfile {{ chrony_keys }} | ||
|
||
# Disable logging of client accesses. | ||
noclientlog | ||
|
||
# Send a message to syslog if a clock adjustment is larger than 0.5 seconds. | ||
logchange 0.5 | ||
|
||
logdir {{ chrony_log_dir }} | ||
#log measurements statistics tracking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# {{ ansible_managed }} | ||
[Time] | ||
NTP={{ timesync_ntp_hosts | default("") | join(" ") }} | ||
FallbackNTP={{ timesync_fallback_ntp_hosts | join(" ") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters