]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Implementing install_ntp in bin/postinst
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 28 Mar 2018 14:17:47 +0000 (16:17 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 28 Mar 2018 14:17:47 +0000 (16:17 +0200)
bin/postinst

index 3b39fcc2af95419923a95fb8e766df320ff540dc..fb39e04f1bd6d98dd013e204f14a9798bc7c8134 100644 (file)
@@ -363,7 +363,7 @@ misc_packages() {
 
     echo
     log "Removing iptables-services ..."
-    yum remove -y install iptables-services
+    yum remove -y iptables-services
     echo "Stopping and disabling firewalld ..."
     systemctl stop firewalld
     systemctl disable firewalld
@@ -415,6 +415,50 @@ install_legato_networker() {
 
 }
 
+#-----------------------------------------------------------
+install_ntp() {
+
+    echo
+    log "Deinstalling chrony from whatever reason ..."
+    echo "Stopping chronyd ..."
+    systemctl stop chronyd
+    echo "Disabling chronyd ..."
+    systemctl disable chronyd
+    echo "Deinstalling chrony ..."
+    yum remove -y chrony
+
+    echo
+    log "Installing NTP ..."
+    yum install -y ntp
+
+    echo "Cofiguring ntpd ..."
+    mkdir -pv /etc/ntp
+
+    cat <<-EOF > /etc/ntp.conf
+       tinker panic 0
+       driftfile /var/lib/ntp/drift
+       # Permit time synchronization with our time source, but do not
+       # permit the source to query or modify the service on this system.
+       restrict default kod nomodify notrap nopeer noquery
+       restrict -6 default kod nomodify notrap nopeer noquery
+       restrict 127.0.0.1
+       restrict -6 ::1
+       server time01.pixelpark.com iburst
+       server time02.pixelpark.com iburst
+       server time03.pixelpark.com iburst
+
+       EOF
+
+    cat <<-EOF > /etc/ntp/step-tickers
+       time01.pixelpark.com
+       time02.pixelpark.com
+       time03.pixelpark.com
+       EOF
+
+    systemctl enable ntpd
+
+}
+
 #-----------------------------------------------------------
 main() {
 
@@ -432,6 +476,7 @@ main() {
     misc_packages
     create_motd
     install_legato_networker
+    install_ntp
 
     tweak_grub