#! /bin/sh
-{ echo; echo; } | adjtimex -h {% if inventory_hostname == 'phdru.name' %}nl{% else %}ru{% endif %}.pool.ntp.org &&
-adjtimex -r --adjust &&
+# 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 %}
-freq=`adjtimex -p | awk '/frequency:/ {print $2}'` &&
-tick=`adjtimex -p | awk '/tick:/ {print $2}'` &&
-#adjtimex -f "$freq" -t "$tick" &&
+ntpdate{% if ansible_facts.os_family == 'Debian' %}-debian{% endif %} -b &&
+hwclock --systohc --update-drift &&
-sed -i "s/^FREQ=.\+$/FREQ=$freq/" /etc/default/adjtimex &&
-sed -i "s/^TICK=.\+$/TICK=$tick/" /etc/default/adjtimex &&
-
-ntpdate-debian &&
-hwclock --systohc &&
-{ echo; echo; } | adjtimex -h ru.pool.ntp.org
+hwclock --get &&
+exec date