]> git.phdru.name Git - ansible.git/blob - playbooks/roles/adjtimex/templates/adjtimex.sh
Feat(adjtimex): Fix pool address at the second run
[ansible.git] / playbooks / roles / adjtimex / templates / adjtimex.sh
1 #! /bin/sh
2
3 { echo; echo; } | adjtimex -h {% if inventory_hostname == 'phdru.name' %}nl{% else %}ru{% endif %}.pool.ntp.org &&
4 adjtimex -r --adjust &&
5
6 freq=`adjtimex -p | awk '/frequency:/ {print $2}'` &&
7 tick=`adjtimex -p | awk '/tick:/ {print $2}'` &&
8 #adjtimex -f "$freq" -t "$tick" &&
9
10 sed -i "s/^FREQ=.\+$/FREQ=$freq/" /etc/default/adjtimex &&
11 sed -i "s/^TICK=.\+$/TICK=$tick/" /etc/default/adjtimex &&
12
13 ntpdate{% if ansible_facts.os_family == 'Debian' %}-debian{% endif %} &&
14 hwclock --systohc &&
15 { echo; echo; } | adjtimex -h {% if inventory_hostname == 'phdru.name' %}nl{% else %}ru{% endif %}.pool.ntp.org &&