X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Froles%2Fntpdate-hwc%2Ftemplates%2Fntpdate-hwc;fp=playbooks%2Froles%2Fntpdate-hwc%2Ftemplates%2Fntpdate-hwc;h=6d97e51b2e38b0a45710cfdb45642c8501057578;hb=4fb45f162c84522806a6959a53ef4adb484471d9;hp=0000000000000000000000000000000000000000;hpb=5f1d35a38ad720f8ac03969bd7fa6b05effa79d6;p=ansible.git diff --git a/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc b/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc new file mode 100755 index 0000000..6d97e51 --- /dev/null +++ b/playbooks/roles/ntpdate-hwc/templates/ntpdate-hwc @@ -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