From 3ad1fceffac2931a1ea18a3b8ea952c21a16f3d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu>
Date: Thu, 16 Feb 2017 14:32:27 +0100
Subject: [PATCH] Install ntp package in correct setup (refs #20488).

---
 1.Base/1.Utilities/0_setup.py          | 2 +-
 2.Common_services/1.Postfix/0_setup.py | 2 +-
 2.Common_services/2.NTP/0_setup.py     | 1 +
 tests/test_apt.sh                      | 4 ++--
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/1.Base/1.Utilities/0_setup.py b/1.Base/1.Utilities/0_setup.py
index 94fd21b8..bb81a0e5 100644
--- a/1.Base/1.Utilities/0_setup.py
+++ b/1.Base/1.Utilities/0_setup.py
@@ -9,7 +9,7 @@ def setup(interactive=True):
     cmds = [
         'apt-get clean',
         'apt-get update',
-        'apt-get install --yes make ipython ipython3 vim netcat git htop iotop bmon host lm-sensors pciutils ntp nfs-client smartmontools pwgen dialog curl python3-requests',
+        'apt-get install --yes make ipython ipython3 vim netcat git htop iotop bmon host lm-sensors pciutils nfs-client smartmontools pwgen dialog curl python3-requests',
         # Locale
         'locale-gen en_GB.UTF-8',
         'update-locale LANG=en_GB.UTF-8 LANGUAGE=en_GB.UTF-8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8',
diff --git a/2.Common_services/1.Postfix/0_setup.py b/2.Common_services/1.Postfix/0_setup.py
index 065167ae..c7fff073 100644
--- a/2.Common_services/1.Postfix/0_setup.py
+++ b/2.Common_services/1.Postfix/0_setup.py
@@ -14,7 +14,7 @@ def setup(interactive=True):
     # Install and configure postfix
     dir_path = utils.get_dir(__file__)
     cmds = [
-        'DEBIAN_FRONTEND=noninteractive apt-get -y install postfix mailutils',
+        'DEBIAN_FRONTEND=noninteractive apt-get install -y postfix mailutils',
         'echo "Replacing /etc/postfix/main.cf"',
         dict(line='write', template='%s/main.cf' % dir_path, target='/etc/postfix/main.cf', params=(
             ('{{ hostname }}', hostname),
diff --git a/2.Common_services/2.NTP/0_setup.py b/2.Common_services/2.NTP/0_setup.py
index c562acfc..5cbf664f 100644
--- a/2.Common_services/2.NTP/0_setup.py
+++ b/2.Common_services/2.NTP/0_setup.py
@@ -7,6 +7,7 @@ def setup(interactive=True):
     dir_path = utils.get_dir(__file__)
     cmds = [
         # NTP
+        'DEBIAN_FRONTEND=noninteractive apt-get install -y ntp',
         'echo "Replacing /etc/ntp.conf"',
         dict(line='write', template='%s/ntp.conf' % dir_path, target='/etc/ntp.conf', params=(
             ('{{ NTP_SERVER }}', utils.get_conf('NTP_SERVER') or utils.get_conf('NTP_SERVER1') or 'ntp.ubuntu.com'),
diff --git a/tests/test_apt.sh b/tests/test_apt.sh
index bc476a3a..43e6626e 100755
--- a/tests/test_apt.sh
+++ b/tests/test_apt.sh
@@ -11,8 +11,8 @@ apt-get clean
 
 if ( dpkg -s sl >/dev/null 2>&1 ); then
    echo "Removing already installed testing package"
-   apt-get -y remove sl
+   apt-get remove -y sl
 fi 
 
 # Installation testing package sl
-apt-get update && apt-get -y install sl && apt-get -y remove sl
+apt-get update && apt-get install -y sl && apt-get remove -y sl
-- 
GitLab