Uwe Gansert wrote:
On Wednesday 13 December 2006 11:25, Uwe Gansert wrote:
1: Is the location paramter supported on Sles 9.3 for init scripts.
yes
sorry, a network location is not supported for init-scripts on SLES9
2: Is this section parsed and the files created at a time when the network is up, so that NFS is available?
yes, that works fine (I just tried it again to be sure)
my test was wrong. A big sorry for that but I accidently raised the network up during my test by myself. At the time where the init-script must be fetched, the network is down on SLES9. So a network <location> does not work. You can try <location>file:///...</location> for the init-script and fetch the script with a post-script (network_needed=true) I did not try that but it should work
Like a lot of folks, I grew weary of XML changes and kind of went the other route. I have a very simplistic path through my code to generate bare bones XML, really 2, one for patterns, one for packages, and tend to do almost all of the post install heavy lifting in a perl script. It's just easier for me to maintain that way, your mileage may vary.
I also give allow my users to layer in as much bash as they'd like in post, so they can tweak things like SSH keys and firewall rules based on what type server they are building. So here's how I did it:
Does this work with DHCP? If you set your interfaces to configure themselves with dhcp, then will a simple /sbin/ifup $nic have them get an IP address also? (I am going back and forth with the idea of giving all my servers static IP's or letting them all dhcp. If I let them all dhcp, then I can basically use 1 xml for all my machines. If I want static addresses, then I have to build an xml per machine.) -Andrew
<scripts> <post-scripts config:type="list"> <script> <filename>final</filename> <interpreter>perl</interpreter> <source> <![CDATA[ #Find a nic to activate for %post install my $nic; opendir(DIR,"/etc/sysconfig/network"); foreach my $file (readdir(DIR)) { next unless ($file =~ /^ifcfg-eth/); print "Found $file -"; $file =~ s/^ifcfg-//; $nic = $file; last; } closedir(DIR); print " calling /sbin/ifup $nic!\n"; system "/sbin/ifup $nic"; open(NIC,">/tmp/nic"); print NIC "$nic\n"; close(NIC);
# A whole bunch of PERL that does stuff like configure apt or yum, install 3rd party software like OpenView, # Data protector, bond production nics, setup NTP server based on location, apply patches, etc. # I own this code, system managers can't touch/see it. # At this point you could wget/execute your final script(s).
]]> </source> </script> <script> <filename>final-user</filename> <interpreter>shell</interpreter> <source> <![CDATA[
# Here's where I put in the system manager's BASH. They do things like tweak firewall rules, install # SSH keys, etc. Since APT/YUM are installed and pointed out our internal depots, they manage all this # stuff using RPMs for the most part.
if [ -r "/tmp/nic" ] then NIC=`cat /tmp/nic` /sbin/ifdown $NIC fi ]]> </source> </script> </post-scripts> </scripts>
Yes, most of this could be done with AutoYast, but I'd have to track every RTG/DTD change, and that got tedious for me. This also works on 9.X/OpenSuSE as well as SLES, so it's how we do it all. Does it take a little longer than doing it all in AutoYast? Maybe, but we tend to install once, run for a LONG time, so it's a don't care for me.
There's more than one way to do it, I work for HP (so we're an HP shop needless to say :). I know this works on ProLiants and lots of different HP desktops/laptops.
Hope that helps,
Lee
-- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org