diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm
index 523644b04..32e4e6caa 100644
--- a/xCAT-server/lib/perl/xCAT/Template.pm
+++ b/xCAT-server/lib/perl/xCAT/Template.pm
@@ -205,18 +205,23 @@ sub subvars {
my $source_in_pre;
my $c = 0;
foreach my $pkgdir(@pkgdirs) {
+ my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$pkgdir";
+ my $http2 = "http://'\$nextserver'$pkgdir";
+ if ( $pkgdir =~ /^http/ ) {
+ $http = $pkgdir;
+ $http2 = $pkgdir;
+ }
if( $platform =~ /^(rh|SL|centos|fedora)$/ ) {
if ( $c == 0 ) {
# After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x
# the rhels5.9 will not be installed successfully. So put in kickstart directly.
- $source_in_pre .= "echo 'url --url http://'\$nextserver'/$pkgdir' >> /tmp/repos";
- $source .= "url --url http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #For rhels5.9
+ $source_in_pre .= "echo 'url --url $http2 >> /tmp/repos";
+ $source .= "url --url $http\n"; #For rhels5.9
} else {
- $source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'/$pkgdir' >> /tmp/repos";
- $source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #for rhels5.9
+ $source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=$http2' >> /tmp/repos";
+ $source .= "repo --name=pkg$c --baseurl=$http\n"; #for rhels5.9
}
} elsif ($platform =~ /^(sles|suse)/) {
- my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$pkgdir";
$source .= "
$http
SuSE-Linux-pkg$c
@@ -224,7 +229,7 @@ sub subvars {
false
SuSE-Linux-pkg$c
";
- $source_in_pre .="http://'\$nextserver'$pkgdirSuSE-Linux-pkg$c/falseSuSE-Linux-pkg$c";
+ $source_in_pre .="$http2SuSE-Linux-pkg$c/falseSuSE-Linux-pkg$c";
}
$c++;
}