]> git.phdru.name Git - ansible.git/blobdiff - playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc
Feat: Rename `adjtimex` -> `ntpdate-hwc`
[ansible.git] / playbooks / roles / ntpdate-hwc / templates / ntpdate-hwc
diff --git a/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc b/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc
new file mode 100755 (executable)
index 0000000..6d97e51
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+# Warm up DNS
+host -t ns pool.ntp.org
+host pool.ntp.org
+{% if ansible_facts.os_family == 'Debian' %}
+host 0.debian.pool.ntp.org
+host 1.debian.pool.ntp.org
+host 2.debian.pool.ntp.org
+host 3.debian.pool.ntp.org
+{% endif %}
+
+ntpdate{% if ansible_facts.os_family == 'Debian' %}-debian{% endif %} -b &&
+hwclock --systohc --update-drift &&
+
+hwclock --get &&
+exec date