Add the lease time for dhcpd.conf which can be configured from site table

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12732 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2012-05-16 12:25:35 +00:00
parent a8e56c8263
commit 91fd0975a5
2 changed files with 17 additions and 6 deletions

View File

@ -792,6 +792,7 @@ site => {
" specify different NICs for different nodes:\n".
" mn|eth1,eth2;service|bond0.\n\n".
" dhcpsetup: If set to 'n', it will skip the dhcp setup process in the nodeset cmd.\n\n".
" dhcplease: The lease time for the dhcp client. The default value is 43200.\n\n".
" disjointdhcps: If set to '1', the .leases file on a service node only contains\n".
" the nodes it manages. The default value is '0'.\n".
" '0' value means include all the nodes in the subnet.\n\n".

View File

@ -1594,11 +1594,17 @@ sub addnet6
}
}
my $dhcplease = 43200;
if (defined $::XCATSITEVALS{'dhcplease'} && $::XCATSITEVALS{'dhcplease'} ne "") {
$dhcplease = $::XCATSITEVALS{'dhcplease'};
}
my @netent = (
" subnet6 $net {\n",
" max-lease-time 43200;\n",
" min-lease-time 43200;\n",
" default-lease-time 43200;\n",
" max-lease-time $dhcplease;\n",
" min-lease-time $dhcplease;\n",
" default-lease-time $dhcplease;\n",
);
#for now, just do address allocatios (phase 1)
#phase 2 (by 2.6 presumably) will include the various things like DNS server and other options allowed by dhcpv6
@ -1821,11 +1827,15 @@ sub addnet
my $maskn = unpack("N", inet_aton($mask));
my $netn = unpack("N", inet_aton($net));
my $dhcplease = 43200;
if (defined $::XCATSITEVALS{'dhcplease'} && $::XCATSITEVALS{'dhcplease'} ne "") {
$dhcplease = $::XCATSITEVALS{'dhcplease'};
}
@netent = (
" subnet $net netmask $mask {\n",
" max-lease-time 43200;\n",
" min-lease-time 43200;\n",
" default-lease-time 43200;\n"
" max-lease-time $dhcplease;\n",
" min-lease-time $dhcplease;\n",
" default-lease-time $dhcplease;\n"
);
if ($gateway)
{