diff --git a/cloud-init-templates/boothook_centos.jinja2 b/cloud-init-templates/boothook_centos.jinja2 index 70e7947..4ead17f 100644 --- a/cloud-init-templates/boothook_centos.jinja2 +++ b/cloud-init-templates/boothook_centos.jinja2 @@ -67,7 +67,8 @@ cloud-init-per instance set_limits echo -e "* soft core unlimited\n* hard core u #cloud-init-per instance dhclient echo 'supersede routers 0;' | tee /etc/dhcp/dhclient.conf # ntp sync -cloud-init-per instance service ntp stop | tee /dev/null +# '| tee /dev/null' is needed for returning zero execution code always +cloud-init-per instance stop_ntpd service ntpd stop | tee /dev/null cloud-init-per instance sync_date ntpdate -t 4 -b {{ common.master_ip }} cloud-init-per instance sync_hwclock hwclock --systohc @@ -83,6 +84,7 @@ cloud-init-per instance edit_ntp_conf6 echo "server {{ common.master_ip }} burst cloud-init-per instance set_ntpdate sed -i 's/SYNC_HWCLOCK\s*=\s*no/SYNC_HWCLOCK=yes/' /etc/sysconfig/ntpdate cloud-init-per instance set_ntpd_0 chkconfig ntpd on cloud-init-per instance set_ntpd_1 chkconfig ntpdate on +cloud-init-per instance start_ntpd service ntpd start cloud-init-per instance removeUseDNS sed -i --follow-symlinks -e '/UseDNS/d' /etc/ssh/sshd_config add_str_to_file_if_not_exists /etc/ssh/sshd_config 'UseDNS' 'UseDNS no' diff --git a/cloud-init-templates/boothook_ubuntu.jinja2 b/cloud-init-templates/boothook_ubuntu.jinja2 index 92fc86a..8612c86 100644 --- a/cloud-init-templates/boothook_ubuntu.jinja2 +++ b/cloud-init-templates/boothook_ubuntu.jinja2 @@ -52,7 +52,8 @@ cloud-init-per instance conntrack_max_set sysctl -w "net.nf_conntrack_max=104857 cloud-init-per instance dhclient echo 'supersede routers 0;' | tee /etc/dhcp/dhclient.conf # ntp sync -cloud-init-per instance service ntp stop | tee /dev/null +# '| tee /dev/null' is needed for returning zero execution code always +cloud-init-per instance stop_ntp service ntp stop | tee /dev/null cloud-init-per instance sync_date ntpdate -t 4 -b {{ common.master_ip }} cloud-init-per instance sync_hwclock hwclock --systohc @@ -61,6 +62,7 @@ cloud-init-per instance edit_ntp_conf2 sed -i '1 i tinker panic 0' /etc/ntp.conf cloud-init-per instance edit_ntp_conf3 echo 0 > /var/lib/ntp/drift cloud-init-per instance edit_ntp_conf4 sed -i '/^\s*server/ d' /etc/ntp.conf cloud-init-per instance edit_ntp_conf5 echo "server {{ common.master_ip }} burst iburst" | tee -a /etc/ntp.conf +cloud-init-per instance start_ntp service ntp start cloud-init-per instance removeUseDNS sed -i --follow-symlinks -e '/UseDNS/d' /etc/ssh/sshd_config add_str_to_file_if_not_exists /etc/ssh/sshd_config 'UseDNS' 'UseDNS no'