diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 5981f1050..bb61dc9d7 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -234,6 +234,7 @@ sub subvars { $inc =~ s/#WINPRODKEY:([^#]+)#/get_win_prodkey($1)/eg; $inc =~ s/#WINNETCFG#/windows_net_cfg()/eg; $inc =~ s/#WINADJOIN#/windows_join_data()/eg; + $inc =~ s/#WINPOSTSCRIPTS#/windows_postscripts()/eg; $inc =~ s/#WINDNSCFG#/windows_dns_cfg()/eg; $inc =~ s/#WINACCOUNTDATA#/windows_account_data()/eg; $inc =~ s/#WINDISABLENULLADMIN#/windows_disable_null_admin()/eg; @@ -409,6 +410,24 @@ sub windows_dns_cfg { $componentxml .= "\r\n\r\n\r\n\r\n"; return $componentxml; } +#this will lay out the data from postscripts table in a manner that is appropriate for windows consumption in Microsoft-Windows-Deployment +#component under specialize pass +sub windows_postscripts { + my $posttab = xCAT::Table->new('postscripts',-create=>0); + unless ($posttab) { return ""; } + my $psent = $posttab->getNodeAttribs($node,['postscripts'],prefetchcache=>1); + unless ($psent and $psent->{postscripts}) { return ""; } + my @cmds = split /,/,$psent->{postscripts}; + my $order = 1; + my $xml; + my $pscript; + foreach $pscripts (@cmds) { + unless ($pscript =~ /\\/) { + $pscript = "C:\\xcatpost\\".$pscript; + } + $xml .= "\r\n$order\r\n$pscript\r\n\r\n"; + } +} #this will examine table data, decide *if* a Microsoft-Windows-UnattendedJoin is warranted #there are two variants in how to proceed: #-Hide domain administrator from node: xCAT will use MACHINEPASSWORD to do joining to AD. Currently requires SSL be enabled on DC. Samba 4 TODO