fuel-library/deployment/puppet/cobbler/templates/snippets/ntp_register_if_enabled.erb
Stanislaw Bogatkin 7a06344429 Stop using sntp and start using ntpdate
Change-Id: I598b3c7edacf0f61a6fc04efac06b25fad2be1f4
Related-Bug: #1417574
2015-02-05 00:20:19 +03:00

12 lines
470 B
Plaintext

#if $str($getVar('ntp_enable', '')) == "1"
## run one-time synchronization and turn ntp service on after reboot
#if $breed == "redhat"
/etc/init.d/ntpdate start
/sbin/chkconfig ntpd on
#elif $breed == "debian" or $breed == "ubuntu"
## we read list of ntp servers from config and sync with them untill first success
awk '$1=="peer"||$1=="server"{ res=system("ntpdate " $2); if(res==0) exit; }' /etc/ntp.conf
/usr/sbin/update-rc.d ntp defaults
#end if
#end if