From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 8/9] NTP servers: Use NtpServer host property Date: Tue, 17 Feb 2015 17:50:30 +0000 Message-ID: <1424195431-1493-9-git-send-email-ian.jackson@eu.citrix.com> References: <1424195431-1493-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YNmVa-0005Mf-FK for xen-devel@lists.xenproject.org; Tue, 17 Feb 2015 18:04:30 +0000 In-Reply-To: <1424195431-1493-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Move the specification of NTP servers in the production-config from the ad-hoc entry in DebianPreseed to a dedicated NtpServer host property. This results in no overall functional change, except that the order of elements in the preseed file is slightly different. Signed-off-by: Ian Jackson diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index a044f8f..cc075a4 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -506,7 +506,7 @@ sub di_installcmdline_core ($$;@) { sub preseed_base ($$$;@) { my ($ho,$suite,$extra_packages,%xopts) = @_; - return <<"END"; + my $preseed = <<"END"; d-i mirror/suite string $suite d-i debian-installer/locale string en_GB @@ -572,10 +572,22 @@ d-i pkgsel/include string openssh-server, ntp, ntpdate, ethtool, chiark-utils-bi $xopts{ExtraPreseed} -### END OF DEBIAN PRESEED BASE +END + + my $ntpserver = get_target_property($ho,'NtpServer'); +use Data::Dumper; +print STDERR "PRESEED NTP ", Dumper($ntpserver); + $preseed .= <<"END" if $ntpserver; +d-i clock-setup/ntp-server string $ntpserver +END + $preseed .= <<"END"; + +### END OF DEBIAN PRESEED BASE END -} + + return $preseed; +} sub preseed_create ($$;@) { my ($ho, $sfx, %xopts) = @_; diff --git a/README b/README index 6e63e97..0a0242c 100644 --- a/README +++ b/README @@ -334,6 +334,11 @@ HostProp__TftpScope Defines the Tftp scope (i.e. subnet) where this host resides. See "TftpFoo_ and TftpFoo" below. +HostProp__NtpServer + NTP server to use. You should probably have your own local + NTP server for production use; the default is to use the operating + system's default (normally, Debian's pool.ntp.org servers). + HostFlags_ Defines a set of flags for the host. Flags is a list separated by whitespace, comma or semi-colon. A flag can be unset by prepending @@ -357,9 +362,7 @@ HostGroupFlags_ merged with the host specific flags. Only used in standalone mode. DebianPreseed - Text to add to the debian-installer preseed file. Optional - but you will need to set some NTP servers here if your firewall - doesn't permit NTP to Debian's pool.ntp.org servers. + Text to add to the debian-installer preseed file. Optional. ======================================== diff --git a/production-config b/production-config index 515bd98..5fbca50 100644 --- a/production-config +++ b/production-config @@ -77,8 +77,9 @@ XenUseUser osstest #DebianMirrorHost debian.uk.xensource.com DebianMirrorHost 10.80.16.196 +HostProp_NtpServer ntp.uk.xensource.com + DebianPreseed= <<'END' -d-i clock-setup/ntp-server string ntp.uk.xensource.com END HostProp_Serial sympathy woking --- production-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/production-config b/production-config index 515bd98..5fbca50 100644 --- a/production-config +++ b/production-config @@ -77,8 +77,9 @@ XenUseUser osstest #DebianMirrorHost debian.uk.xensource.com DebianMirrorHost 10.80.16.196 +HostProp_NtpServer ntp.uk.xensource.com + DebianPreseed= <<'END' -d-i clock-setup/ntp-server string ntp.uk.xensource.com END HostProp_Serial sympathy woking -- 1.7.10.4