Skip to content

Commit c1222ad

Browse files
committed
Add a command to resynchronise NTP.
1 parent 7c95d38 commit c1222ad

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

fabfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import licensify
1515
import mongo
1616
import nginx
17+
import ntp
1718
import puppet
1819
import rkhunter
1920
import search

ntp.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from fabric.api import *
2+
3+
@task
4+
def resync():
5+
"""Forcibly resynchronise the VM's NTP clock.
6+
7+
If a VM's clock manages to get sufficiently out of sync, ntp will give up,
8+
forcing a manual intervention.
9+
"""
10+
sudo("service ntp stop")
11+
sudo("ntpdate ntp.ubuntu.com")
12+
sudo("service ntp start")

0 commit comments

Comments
 (0)