Hello Marek,
> BTW - can you provide me any links to materials how can I use the perl
> in kickstart configs? Is it possible eg. to pass the MAC address or
> hostname (from DHCP) of the ESXi host to kickstart script and generate
> it dynamically?
most certainly it is, but I simply use the ip address of the calling
client:
(excalibur) [/export/ISO] cat /usr/lib/cgi-bin/esxi5.pl
#!/usr/bin/perl -w
use strict;
use warnings FATAL => 'all';
use Socket;
print "Content-type:text/plain\r\n\r\n";
my $hostname = gethostbyaddr(inet_aton($ENV{REMOTE_ADDR}), AF_INET) or die
"Can't resolve $ENV{REMOTE_ADDR}: $!";
my $gateway = '10.10.10.1';
print <<EOF;
vmaccepteula
rootpw Pa\$\$w0rd
install --firstdisk --overwritevmfs
network --addvmportgroup=true --device=vmnic0 --bootproto=static
--ip=$ENV{REMOTE_ADDR} --netmask=255.255.255.0 --gateway=${gateway}
--nameserver=10.10.10.1 --hostname=$hostname
reboot
EOF
Cheers,
Thomas
_______________________________________________
ipxe-devel mailing list
[email protected]
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel