summaryrefslogtreecommitdiffstats
path: root/ansible/roles/chrony/templates
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-03-26 16:10:10 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-04-02 15:25:58 +0200
commit30b2cbf179448d2761af53494a694f4ce986d623 (patch)
treea25f6eff088a5fcd83cc57ca8b741dc5d76dbeed /ansible/roles/chrony/templates
parent53036e8f41f50cb7ebb2346d02442d80bc16ece0 (diff)
Support time synchronization on hosts
This change introduces functionality to synchronize infra/kube nodes' clock with external NTP authority. Configuring external time source is optional, however default behaviour will be to setup NTP time source on infra-node and sync kube-nodes clock with it. It's also possible to setup custom time zone. Change-Id: I725ce9a306da1977628b6c03d5ff10fca77fb3b0 Issue-ID: OOM-1710 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles/chrony/templates')
-rw-r--r--ansible/roles/chrony/templates/chrony.conf.j222
1 files changed, 22 insertions, 0 deletions
diff --git a/ansible/roles/chrony/templates/chrony.conf.j2 b/ansible/roles/chrony/templates/chrony.conf.j2
new file mode 100644
index 00000000..3bfb4e40
--- /dev/null
+++ b/ansible/roles/chrony/templates/chrony.conf.j2
@@ -0,0 +1,22 @@
+{% if chrony_mode == 'server' %}
+local stratum 1
+allow
+{% elif chrony_mode == 'client' %}
+{% for tserver in chrony.servers %}
+server {{ tserver }} iburst
+{% endfor %}
+{% if chrony.slewclock == false %}
+{# Step the time by default #}
+makestep {{ chrony.makestep }}
+{% else %}
+{# Slew the clock but step at boot time if time error larger than 30 seconds #}
+initstepslew {{ chrony.initstepslew }}{% for tserver in chrony.servers %} {{ tserver }}{% endfor %}
+
+{% endif %}
+{% if timesync.servers is not defined %}
+maxjitter {{ chrony.maxjitter }}
+{% endif %}
+{% endif %}
+driftfile {{ chrony['conf'][ansible_os_family]['driftfile'] }}
+rtcsync
+logdir /var/log/chrony