Configure NTP to mirantis internal
Related-Prod: PRODX-00000
Change-Id: Ie433d00096d98bd48597bfe6574333aa2513b3a9
diff --git a/de/heat-templates/scripts/instance_boot.sh b/de/heat-templates/scripts/instance_boot.sh
index 0795c80..79f038f 100644
--- a/de/heat-templates/scripts/instance_boot.sh
+++ b/de/heat-templates/scripts/instance_boot.sh
@@ -44,6 +44,7 @@
PUBLIC_INTERFACE=${PUBLIC_INTERFACE:-ens4}
UCP_MASTER_HOST=${UCP_MASTER_HOST:-${NODE_IP_ADDRESS}}
UCP_IP_ADDRESS=${UCP_IP_ADDRESS:-$NODE_IP_ADDRESS}
+NTP_SERVERS=${NTP_SERVERS:-"ldap.scc.mirantis.net ldap.bud.mirantis.net"}
function retry {
@@ -215,10 +216,38 @@
EOF
}
+function configure_ntp {
+ cat << EOF > /etc/systemd/timesyncd.conf
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See timesyncd.conf(5) for details.
+
+[Time]
+NTP=${NTP_SERVERS}
+#FallbackNTP=ntp.ubuntu.com
+#RootDistanceMaxSec=5
+#PollIntervalMinSec=32
+#PollIntervalMaxSec=2048
+EOF
+
+ systemctl restart systemd-timesyncd
+}
+
function prepare_network {
systemctl restart systemd-resolved
# Make sure local hostname is present in /etc/hosts
sed -i "s/127.0.0.1 localhost/127.0.0.1 localhost\n${NODE_IP_ADDRESS} $(hostname)/" /etc/hosts
+
+ configure_ntp
}
function workaround_default_forward_policy {