Skip to main content

NTP

Date

date

Install

sudo apt-get install ntpdate
sudo service ntp stop
sudo ntpdate 0.se.pool.ntp.org
sudo service ntp start

Using Ansible to install

ansible <servername or ip> --become  -m shell -a 'apt-get install ntpdate; service ntp stop; ntpdate 0.se.pool.ntp.org;service ntp start'

Using Ansible to check

ansible <servername or ip> --become  -m shell -a 'ntpq -nc peers;date;hostname'