From d9100200e1da374e14cc4b48741c7e4991cd0324 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 19 Jun 2013 12:43:34 +0000 Subject: [PATCH] Simple implementation of postscripts, put in postscripts table and /install/winpostscripts git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16689 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Template.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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