Re: [Unattended] Obtaining values from a spreadsheet
On Thu, 25 Mar 2004 10:51 am, Patrick J. LoPresti wrote: > The question is whether to leave this as an example or to make it (or > something like it) the default. There appears to be a larger number of options that people want to support each day. If we have 10 different options for people to choose about how they store their data, which one should be default? I assume this is sort of where you question is going Patrick. This is why I still think you are better off leaving the default as answering the questions. Create information in the documentation about how to copy config-sql.pl, or config-txt.pl to config.pl. And what information you have to supply in the relevant files. This will mean people don't need to know how to use perl, just how to copy files :) I've found 2 bits that are hard with unattended; 1. Getting all the apps going by themselves 2. Getting it all to boot by itself, not user intervention (Spreadsheet, PXE) Usually people will want to sort out applications before worrying about how the machine boots, because they will be there testing everything. But then again, maybe they don't want to answer questions while doing that. So with a number of options arising, SQL, LDAP, txt, csv. My thoughts are that people can just copy the relevant file over config.pl if so desired. Regards Russell Smith. --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ unattended-info mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unattended-info
RE: [Unattended] Obtaining values from a spreadsheet
Hi, Just some ideas. I am not much of a coder so I can't really offer samples. Everyone is going to want to do things differently. Would it be possible to offer a variety of mechanism (spreadsheet(s), SQL, text file, etc.) to store the relent information? A configuration file or config.pl could specify what mechanism will be used for that particular site. Support for each could be added incrementally. I personally would like to store the information in AD (LDAP). My 2 cents Brad --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ unattended-info mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unattended-info
Re: [Unattended] Obtaining values from a spreadsheet
The question is whether to leave this as an example or to make it (or something like it) the default. OK, here is what I am thinking. Forgive me while I think out loud... I am sympathetic to Shad's argument that people should have a simple way to use spreadsheets. I am also sympathetic to the notion that different people may want the spreadsheet layed out in different ways. I am trying to think of a clean design which would make it easy for Perl novices to configure this stuff. It really comes down to specifying three things: 1) Which spreadsheet(s) to use 2) Within each spreadsheet, how to find the record you want 3) How to map the fields of that record into unattend.txt settings (Some people might want to use something other than a spreadsheet, like a SQL database. We should allow that easily too.) Perhaps we should provide some helper functions to make this sort of thing easier to write and to read. The first step is to add some indirection. Some people want to locate their spreadsheet entry by MAC address. Others (like yours truly) want to prompt the user for an asset tag number and locate the entry that way. Others might want to look it up by Dell service tag. So, I think we should store the hardware and software records in a pair of new keys: $u->{'_meta'}->{'hardware_record'} = sub { # Here we have code to find the hardware record and return # a reference to an associative array. (I bet you didn't # know you could store one of these in an # Unattend::IniFile. Well, you can.) # We can provide sample code to locate this record by MAC # address, asset tag, and Dell service tag. }; $u->{'_meta'}->{'software_record'} = sub { # Similarly, but for software. Russ doesn't want a # separate software spreadsheet, so he would just put this # here: # return $u->{'_meta'}->{'hardware_record'}; # ...thus making the software record the same as the # hardware record, letting him put his license keys in the # hardware speadsheet. }; We could provide default implementations for these subroutines which we think make sense (Shad's implementation). Or we could just leave them as examples. I am leaning towards the former, although I am still open to arguments. But mostly, I want to get this interface right. The code for Shad's [UserData]/FullName setting would then look like this: $u->push_value ('UserData', 'FullName', from_record ('_meta', 'hardware_record', 'Owner')); Here, from_record() is a helper routine we will provide which returns a subroutine to do the desired lookup, returning undef if it is cannot. (I am glossing over the definition of "cannot"... Should an empty field return undef? Let's worry about that later.) This provides a simple (well, simpler) way to declare that the [UserData]/FullName setting should come from the 'Owner' field of the hardware record. Similar 1-2 liners would let you declare all the other settings which come from the spreadsheets. Maybe from_record() should assume '_meta' as the default to make the code shorter. Anyway, those are my musings. Comments? - Pat --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ unattended-info mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unattended-info
RE: [Unattended] Obtaining values from a spreadsheet
> > Having a set of configs that people can > > just copy in to > > make things work would probably be helpful. But Others, > > like myself will want to mix and match. > > but will give the ability to > manage entries to > those that aren't comfortable writing perl. > For me it has major advantages, so I'm supportive for these kind of sample's (untill I understand the perl part enough) This system (way of life ?) is capable of a lot, and it takes some time to figure it all out. Any help is welcome ;) GreetZ, Stephan --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ unattended-info mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unattended-info
Re: [Unattended] Obtaining values from a spreadsheet
- Original Message - From: "Russell Smith" <[EMAIL PROTECTED]> > This is a helpful and useful Idea, however I'm not 100% sure making it default > is easiest/best. Having a set of configs that people can just copy in to > make things work would probably be helpful. But Others, like myself will > want to mix and match. The way the sample-config.pl that I wrote is just an extension to the questions that already exists. If any of the fields are blank or it can't find a record with matching MAC then it falls back to the question. This makes it so you don't loose any functionality but gain the ability to to have lookup tables. If we integrate this into the default behavior I would assume that it would behave similar. Also by integrating it into the base distribution, if you don't like the behavior you can still override it by writing your own config.pl like you have done. Personally I don't see this changing anyones installation but will give the ability to manage entries to those that aren't comfortable writing perl. -Shad --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ unattended-info mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unattended-info
Re: [Unattended] Obtaining values from a spreadsheet
Also out of interest, and maybe a little boasting. :( I have attached the config.pl I use as an example also. I am no brilliant Perl coders, but this functions quite well. I have also changed the WinMedia included so I can specific the place to check drivers for.$u->{'_meta'}->{'drivers_dir'} = 'none'; # Function to set Driver Paths for Each Machine # Drivers Should be stored in Z:\Drivers\\ # all drivers for a given machine/type should be stored here. # drivers will be copied to machines before installation sub oem_pnp_dirs ($;$) { my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'}); my $oem_system_dir = "z:\\Drivers\\".$u->{'_meta'}->{'drivers_dir'}; print "Looking for drivers under $oem_system_dir...\n"; my @ret = $media_obj->oem_pnp_dirs (1, $oem_system_dir); #my @ret = $media_obj->oem_pnp_dirs (1); $verbose && scalar @ret == 0 and print "...no driver directories found.\n"; foreach my $dir (@ret) { push @selecteddirs, "Drivers\\".$dir; } my $ret = join ';', @selecteddirs; return $ret; } #Open PC file and find The Current PC as its parameters # File format Tab seperated list # Computer Name MYCOMPUTER # MAC Address 4455AACC # Operating System # Software Script top (runs top.bat to install apps) # Driver Directory IBM6288 # OEM Product Key X-X-X-X-X open(pcs, 'z:\\site\\pc'); while() { chop; ($image,$pc,$mac,$os,$software,$drivers,$productkey) = split(/\t/); if ( $mac eq $u->{'_meta'}->{'macaddr'}) { $u->{'_meta'}->{'OS'} = $os; $u->{'_meta'}->{'top'} = $software.".bat"; $u->{'UserData'}->{'ComputerName'} = $pc; $u->{'_meta'}->{'drivers_dir'} = $drivers; $u->{'UserData'}->{'ProductKey'} = $productkey; last; } } if ( $mac != $u->{'_meta'}->{'macaddr'}) { print $u->{'_meta'}->{'macaddr'}; #my $newpcname = simple_q ("Enter PC's Name: "); #my $newpcmac = get_value('_meta','macaddr'); #open(NEWPC,">>z:\\tmp\\newpc") || die ("Cannot Add New PC to File"); #print NEWPC "$newpcname\t$newpcmac\n"; #close NEWPC; die "Added to the new list, please configure it and restart"; # I should ask questions here, and get it added to the list # of newpc's like in the old version. } #Make boot mac address, strip leading 0's from bytes, last 8 bytes. #00AABB0DCCE0 -> 0AABBDCCE0 -> ABBDCCE0 my $mac = $u->{'_meta'}->{'macaddr'}; my $newmac = ""; for ($i=0; $i<6 ;$i++) { $j=substr($mac,($i*2),2); if (substr($j,0,1) eq "0") { $j=substr($j,1); } $newmac = $newmac . $j; } $newmac = substr($newmac,-8); #Now set doit to tell machine to boot from local machine #my $copying = "copy /Y z:\\tftpboot\\pxelinux.cfg\\hdd z:\\tftpboot\\pxelinux.cfg\\$newmac;"; my $copying = "copy /Y z:\\tftpboot\\pxelinux.cfg\\hdd z:\\tftpboot\\pxelinux.cfg\\$newmac;"; # Set doit.bat to copy drivers to machine to install. $copying .= "mkdir C:\\Drivers;xcopy /Y /S z:\\Drivers\\$drivers c:\\Drivers\\;"; $u->{'_meta'}->{'doit_cmds'} = $copying . $u->{'_meta'}->{'doit_cmds'}; # Set PNP drivers. $u->{'Unattended'}->{'OemPnPDriversPath'} = \&oem_pnp_dirs; $u->{'_meta'}->{'autolog'} = 'autolog.pl --logon=0'; rtlnet LAB1PCA06 0020ED895A3CwinxpoemFbase build03 X-X-X-X-X rtlnet LAB1PCD02 0020ED896F12winxpoemFvideo build03 X-X-X-X-X e100net SPECEDPCA5 0002B3EB2A3FwinxpoemFbase lib04 X-X-X-X-X e100net LIB1PCA03 0002B3EB2C60winxpoemFliblib04 X-X-X-X-X --- unattended/install/lib/Unattend/WinMedia.pm 2004-03-16 11:56:13.0 +1100 +++ lib/Unattend/WinMedia.pm 2004-03-16 13:38:28.0 +1100 @@ -272,9 +272,12 @@ sub oem_pnp_dirs ($;$) { my Unattend::WinMedia $self = shift; my $verbose = shift; +my $oem_system_dir = shift; -my $oem_system_dir = +if (!$oem_system_dir) { +$oem_system_dir = $file_spec->catdir ($self->path (), 'i386', '$oem$', '$1'); +} $verbose and print "Looking for drivers under $oem_system_dir...\n";
Re: [Unattended] Obtaining values from a spreadsheet
This is a helpful and useful Idea, however I'm not 100% sure making it default is easiest/best. Having a set of configs that people can just copy in to make things work would probably be helpful. But Others, like myself will want to mix and match. Most if not all of the licenses for XP i Use are OEM, so I like to keep the license XP license in the hardware section, with the computer. I have adjusted Drivers, so you can specify the drivers location, and not download 2G of Drivers onto every machines. Has anybody successfully done this with other applications? eg putting different serial numbers into a setup.iss or autoit script to install an application with different numbers on different computers. I run into this all the time. And am not sure if it's easy/possible. Could all the Unattended libs be used to parse the setup.iss file too? Looks like more perl learning if that's possible. :) Regards Russell Smith --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ unattended-info mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unattended-info
[Unattended] Obtaining values from a spreadsheet
In Unattended 4.0b, we added some new files to the install/site directory: hardware.csv software.csv sample-config.pl The file "sample-config.pl" is the actual config.pl which Shad uses. It automatically sets several installation parameters based on the values in two comma-separated-value (CSV) spreadsheets. We are thinking about making this behavior, or something like it, the default for the next release. So this message is both a description of the implementation and a request for feedback on it. The first spreadsheet, hardware.csv, has fields for MAC address, computer name, "owner" (aka. [UserData]/FullName), and organization. These are fairly self-explanatory... If the MAC address of the system matches a line in the spreadsheet, the remaining fields will be used to fill in the corresponding unattend.txt parameters. In other words, the MAC is the "index key" for this spreadsheet. The second spreadsheet, software.csv, lists software licenses. It has fields for "owner", "software" (the name of the software product), the license key, and the local admin password. The "owner" and "software" keys are the index keys for this spreadsheet. The "software" field must match the operating system name (e.g., "Windows XP Professional"). The "owner" field must match either the MAC address, user name, computer name, or organization of the machine. If a match is found, the license key and administrator password are set from the values in the spreadsheet. The idea is that a software license is "owned" by a machine (MAC address or name), or by a user, or by an organization (think volume licenses). I am thinking of ways to generalize this to use a key other than MAC address, like (say) the Dell service tag. More on that later. But the implementation described here would still be the default. What do you folks think? (By the way, it is a fully functioning implementation. If you want to try it out, just copy sample-config.pl to Z:\site\config.pl.) - Pat --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ unattended-info mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unattended-info