|
|
1330ca |
--- ./cobbler/field_info.py 2010-07-28 17:48:48.000000000 +0200
|
|
|
1330ca |
+++ ./cobbler/field_info.py 2012-01-26 13:43:04.000000000 +0100
|
|
|
1330ca |
@@ -58,6 +58,7 @@ USES_CHECKBOX = [
|
|
|
1330ca |
"*netboot_enabled",
|
|
|
1330ca |
"netboot_enabled",
|
|
|
1330ca |
"*static",
|
|
|
1330ca |
+ "ipv6_autoconfiguration",
|
|
|
1330ca |
"keep_updated",
|
|
|
1330ca |
"mirror_locally",
|
|
|
1330ca |
"virt_auto_boot"
|
|
|
1330ca |
@@ -101,6 +102,7 @@ BLOCK_MAPPINGS = {
|
|
|
1330ca |
"broadcast" : "Networking", # ..
|
|
|
1330ca |
"reserved" : "Networking", # ..
|
|
|
1330ca |
"*mac_address" : "Networking",
|
|
|
1330ca |
+ "*mtu" : "Networking",
|
|
|
1330ca |
"*ip_address" : "Networking",
|
|
|
1330ca |
"*dhcp_tag" : "Networking",
|
|
|
1330ca |
"*static" : "Networking",
|
|
|
1330ca |
@@ -110,17 +112,24 @@ BLOCK_MAPPINGS = {
|
|
|
1330ca |
"*dns_name" : "Networking",
|
|
|
1330ca |
"*static_routes" : "Networking",
|
|
|
1330ca |
"*subnet" : "Networking",
|
|
|
1330ca |
- "hostname" : "Networking (Global)",
|
|
|
1330ca |
- "gateway" : "Networking (Global)",
|
|
|
1330ca |
- "name_servers" : "Networking (Global)",
|
|
|
1330ca |
- "name_servers_search" : "Networking (Global)",
|
|
|
1330ca |
- "repos" : "General",
|
|
|
1330ca |
- "dhcp_tag" : "Advanced",
|
|
|
1330ca |
- "mgmt_classes" : "Management",
|
|
|
1330ca |
- "template_files" : "Management",
|
|
|
1330ca |
- "network_widget_a" : "Networking",
|
|
|
1330ca |
- "network_widget_b" : "Networking",
|
|
|
1330ca |
- "server" : "Advanced",
|
|
|
1330ca |
+ "*ipv6_address" : "Networking",
|
|
|
1330ca |
+ "*ipv6_secondaries" : "Networking",
|
|
|
1330ca |
+ "*ipv6_mtu" : "Networking",
|
|
|
1330ca |
+ "*ipv6_static_routes" : "Networking",
|
|
|
1330ca |
+ "*ipv6_default_gateway" : "Networking",
|
|
|
1330ca |
+ "hostname" : "Networking (Global)",
|
|
|
1330ca |
+ "gateway" : "Networking (Global)",
|
|
|
1330ca |
+ "name_servers" : "Networking (Global)",
|
|
|
1330ca |
+ "name_servers_search" : "Networking (Global)",
|
|
|
1330ca |
+ "ipv6_default_device" : "Networking (Global)",
|
|
|
1330ca |
+ "ipv6_autoconfiguration" : "Networking (Global)",
|
|
|
1330ca |
+ "repos" : "General",
|
|
|
1330ca |
+ "dhcp_tag" : "Advanced",
|
|
|
1330ca |
+ "mgmt_classes" : "Management",
|
|
|
1330ca |
+ "template_files" : "Management",
|
|
|
1330ca |
+ "network_widget_a" : "Networking",
|
|
|
1330ca |
+ "network_widget_b" : "Networking",
|
|
|
1330ca |
+ "server" : "Advanced",
|
|
|
1330ca |
"redhat_management_key" : "Management",
|
|
|
1330ca |
"redhat_management_server" : "Management",
|
|
|
1330ca |
"createrepo_flags" : "Advanced",
|
|
|
1330ca |
--- ./cobbler/item_system.py 2010-07-28 17:48:48.000000000 +0200
|
|
|
1330ca |
+++ ./cobbler/item_system.py 2012-01-26 13:43:04.000000000 +0100
|
|
|
1330ca |
@@ -59,9 +59,12 @@ FIELDS = [
|
|
|
1330ca |
["gateway","",0,"Gateway",True,"",0,"str"],
|
|
|
1330ca |
["name_servers",[],0,"Name Servers",True,"space delimited",0,"list"],
|
|
|
1330ca |
["name_servers_search",[],0,"Name Servers Search Path",True,"space delimited",0,"list"],
|
|
|
1330ca |
+ ["ipv6_default_device","",0,"IPv6 Default Device",True,"",0,"str"],
|
|
|
1330ca |
+ ["ipv6_autoconfiguration",False,0,"IPv6 Autoconfiguration",True,"",0,"bool"],
|
|
|
1330ca |
["network_widget_a","",0,"Add Interface",True,"",0,"str"], # not a real field, a marker for the web app
|
|
|
1330ca |
["network_widget_b","",0,"Edit Interface",True,"",0,"str"], # not a real field, a marker for the web app
|
|
|
1330ca |
["*mac_address","",0,"MAC Address",True,"(Place \"random\" in this field for a random MAC Address.)",0,"str"],
|
|
|
1330ca |
+ ["*mtu","",0,"MTU",True,"",0,"str"],
|
|
|
1330ca |
["*ip_address","",0,"IP Address",True,"",0,"str"],
|
|
|
1330ca |
["*bonding","na",0,"Bonding Mode",True,"",["na","master","slave"],"str"],
|
|
|
1330ca |
["*bonding_master","",0,"Bonding Master",True,"",0,"str"],
|
|
|
1330ca |
@@ -72,6 +75,11 @@ FIELDS = [
|
|
|
1330ca |
["*dns_name","",0,"DNS Name",True,"",0,"str"],
|
|
|
1330ca |
["*static_routes",[],0,"Static Routes",True,"",0,"list"],
|
|
|
1330ca |
["*virt_bridge","",0,"Virt Bridge",True,"",0,"str"],
|
|
|
1330ca |
+ ["*ipv6_address","",0,"IPv6 Address",True,"",0,"str"],
|
|
|
1330ca |
+ ["*ipv6_secondaries",[],0,"IPv6 Secondaries",True,"space delimited",0,"list"],
|
|
|
1330ca |
+ ["*ipv6_mtu","",0,"IPv6 MTU",True,"",0,"str"],
|
|
|
1330ca |
+ ["*ipv6_static_routes",[],0,"IPv6 Static Routes",True,"",0,"list"],
|
|
|
1330ca |
+ ["*ipv6_default_gateway","",0,"IPv6 Default Gateway",True,"",0,"str"],
|
|
|
1330ca |
["mgmt_classes",[],0,"Management Classes",True,"For external config management",0,"list"],
|
|
|
1330ca |
["template_files",{},0,"Template Files",True,"File mappings for built-in configuration management",0,"dict"],
|
|
|
1330ca |
["redhat_management_key","<<inherit>>",0,"Red Hat Management Key",True,"Registration key for RHN, Satellite, or Spacewalk",0,"str"],
|
|
|
1330ca |
@@ -114,6 +122,7 @@ class System(item.Item):
|
|
|
1330ca |
if not self.interfaces.has_key(name):
|
|
|
1330ca |
self.interfaces[name] = {
|
|
|
1330ca |
"mac_address" : "",
|
|
|
1330ca |
+ "mtu" : "",
|
|
|
1330ca |
"ip_address" : "",
|
|
|
1330ca |
"dhcp_tag" : "",
|
|
|
1330ca |
"subnet" : "",
|
|
|
1330ca |
@@ -124,6 +133,11 @@ class System(item.Item):
|
|
|
1330ca |
"bonding_opts" : "",
|
|
|
1330ca |
"dns_name" : "",
|
|
|
1330ca |
"static_routes" : [],
|
|
|
1330ca |
+ "ipv6_address" : "",
|
|
|
1330ca |
+ "ipv6_secondaries" : [],
|
|
|
1330ca |
+ "ipv6_mtu" : "",
|
|
|
1330ca |
+ "ipv6_static_routes" : [],
|
|
|
1330ca |
+ "ipv6_default_gateway" : "",
|
|
|
1330ca |
}
|
|
|
1330ca |
|
|
|
1330ca |
return self.interfaces[name]
|
|
|
1330ca |
@@ -364,6 +378,65 @@ class System(item.Item):
|
|
|
1330ca |
intf["bonding_opts"] = bonding_opts
|
|
|
1330ca |
return True
|
|
|
1330ca |
|
|
|
1330ca |
+ def set_ipv6_autoconfiguration(self,truthiness):
|
|
|
1330ca |
+ self.ipv6_autoconfiguration = utils.input_boolean(truthiness)
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+
|
|
|
1330ca |
+ def set_ipv6_default_device(self,interface_name):
|
|
|
1330ca |
+ if interface_name is None:
|
|
|
1330ca |
+ interface_name = ""
|
|
|
1330ca |
+ self.ipv6_default_device = interface_name
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+
|
|
|
1330ca |
+ def set_ipv6_address(self,address,interface):
|
|
|
1330ca |
+ """
|
|
|
1330ca |
+ Assign a IP or hostname in DHCP when this MAC boots.
|
|
|
1330ca |
+ Only works if manage_dhcp is set in /etc/cobbler/settings
|
|
|
1330ca |
+ """
|
|
|
1330ca |
+ intf = self.__get_interface(interface)
|
|
|
1330ca |
+ if address == "" or utils.is_ip(address):
|
|
|
1330ca |
+ intf["ipv6_address"] = address.strip()
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+ raise CX(_("invalid format for IPv6 IP address (%s)") % address)
|
|
|
1330ca |
+
|
|
|
1330ca |
+ def set_ipv6_secondaries(self,addresses,interface):
|
|
|
1330ca |
+ intf = self.__get_interface(interface)
|
|
|
1330ca |
+ data = utils.input_string_or_list(addresses)
|
|
|
1330ca |
+ secondaries = []
|
|
|
1330ca |
+ for address in data:
|
|
|
1330ca |
+ if address == "" or utils.is_ip(address):
|
|
|
1330ca |
+ secondaries.append(address)
|
|
|
1330ca |
+ else:
|
|
|
1330ca |
+ raise CX(_("invalid format for IPv6 IP address (%s)") % address)
|
|
|
1330ca |
+
|
|
|
1330ca |
+ intf["ipv6_secondaries"] = secondaries
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+
|
|
|
1330ca |
+ def set_ipv6_default_gateway(self,address,interface):
|
|
|
1330ca |
+ intf = self.__get_interface(interface)
|
|
|
1330ca |
+ if address == "" or utils.is_ip(address):
|
|
|
1330ca |
+ intf["ipv6_default_gateway"] = address.strip()
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+ raise CX(_("invalid format for IPv6 IP address (%s)") % address)
|
|
|
1330ca |
+
|
|
|
1330ca |
+ def set_ipv6_static_routes(self,routes,interface):
|
|
|
1330ca |
+ intf = self.__get_interface(interface)
|
|
|
1330ca |
+ data = utils.input_string_or_list(routes)
|
|
|
1330ca |
+ intf["ipv6_static_routes"] = data
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+
|
|
|
1330ca |
+ def set_ipv6_mtu(self,mtu,interface):
|
|
|
1330ca |
+ intf = self.__get_interface(interface)
|
|
|
1330ca |
+ intf["ipv6_mtu"] = mtu
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+
|
|
|
1330ca |
+ def set_mtu(self,mtu,interface):
|
|
|
1330ca |
+ intf = self.__get_interface(interface)
|
|
|
1330ca |
+ intf["mtu"] = mtu
|
|
|
1330ca |
+ return True
|
|
|
1330ca |
+
|
|
|
1330ca |
+
|
|
|
1330ca |
+
|
|
|
1330ca |
def set_profile(self,profile_name):
|
|
|
1330ca |
"""
|
|
|
1330ca |
Set the system to use a certain named profile. The profile
|
|
|
1330ca |
@@ -503,17 +576,23 @@ class System(item.Item):
|
|
|
1330ca |
for (key,value) in hash.iteritems():
|
|
|
1330ca |
(field,interface) = key.split("-")
|
|
|
1330ca |
field = field.replace("_","").replace("-","")
|
|
|
1330ca |
- if field == "macaddress" : self.set_mac_address(value, interface)
|
|
|
1330ca |
- if field == "ipaddress" : self.set_ip_address(value, interface)
|
|
|
1330ca |
- if field == "dnsname" : self.set_dns_name(value, interface)
|
|
|
1330ca |
- if field == "static" : self.set_static(value, interface)
|
|
|
1330ca |
- if field == "dhcptag" : self.set_dhcp_tag(value, interface)
|
|
|
1330ca |
- if field == "subnet" : self.set_subnet(value, interface)
|
|
|
1330ca |
- if field == "virtbridge" : self.set_virt_bridge(value, interface)
|
|
|
1330ca |
- if field == "bonding" : self.set_bonding(value, interface)
|
|
|
1330ca |
- if field == "bondingmaster" : self.set_bonding_master(value, interface)
|
|
|
1330ca |
- if field == "bondingopts" : self.set_bonding_opts(value, interface)
|
|
|
1330ca |
- if field == "staticroutes" : self.set_static_routes(value, interface)
|
|
|
1330ca |
+ if field == "macaddress" : self.set_mac_address(value, interface)
|
|
|
1330ca |
+ if field == "mtu" : self.set_mtu(value, interface)
|
|
|
1330ca |
+ if field == "ipaddress" : self.set_ip_address(value, interface)
|
|
|
1330ca |
+ if field == "dnsname" : self.set_dns_name(value, interface)
|
|
|
1330ca |
+ if field == "static" : self.set_static(value, interface)
|
|
|
1330ca |
+ if field == "dhcptag" : self.set_dhcp_tag(value, interface)
|
|
|
1330ca |
+ if field == "subnet" : self.set_subnet(value, interface)
|
|
|
1330ca |
+ if field == "virtbridge" : self.set_virt_bridge(value, interface)
|
|
|
1330ca |
+ if field == "bonding" : self.set_bonding(value, interface)
|
|
|
1330ca |
+ if field == "bondingmaster" : self.set_bonding_master(value, interface)
|
|
|
1330ca |
+ if field == "bondingopts" : self.set_bonding_opts(value, interface)
|
|
|
1330ca |
+ if field == "staticroutes" : self.set_static_routes(value, interface)
|
|
|
1330ca |
+ if field == "ipv6address" : self.set_ipv6_address(value, interface)
|
|
|
1330ca |
+ if field == "ipv6secondaries" : self.set_ipv6_secondaries(value, interface)
|
|
|
1330ca |
+ if field == "ipv6mtu" : self.set_ipv6_mtu(value, interface)
|
|
|
1330ca |
+ if field == "ipv6staticroutes" : self.set_ipv6_static_routes(value, interface)
|
|
|
1330ca |
+ if field == "ipv6defaultgateway" : self.set_ipv6_default_gateway(value, interface)
|
|
|
1330ca |
return True
|
|
|
1330ca |
|
|
|
1330ca |
def check_if_valid(self):
|
|
|
1330ca |
--- ./snippets/post_install_network_config 2010-07-28 17:48:48.000000000 +0200
|
|
|
1330ca |
+++ ./snippets/post_install_network_config 2012-01-26 15:53:46.000000000 +0100
|
|
|
1330ca |
@@ -14,6 +14,7 @@
|
|
|
1330ca |
#
|
|
|
1330ca |
#set $configbymac = True
|
|
|
1330ca |
#set $numbondingdevs = 0
|
|
|
1330ca |
+ #set $enableipv6 = False
|
|
|
1330ca |
## =============================================================================
|
|
|
1330ca |
#for $iname in $ikeys
|
|
|
1330ca |
## look at the interface hash data for the specific interface
|
|
|
1330ca |
@@ -29,6 +30,12 @@
|
|
|
1330ca |
#if $idata["bonding"].lower() == "master"
|
|
|
1330ca |
#set $numbondingdevs += 1
|
|
|
1330ca |
#end if
|
|
|
1330ca |
+
|
|
|
1330ca |
+ ## enable IPv6 networking if we set an ipv6 address or turn on autoconfiguration
|
|
|
1330ca |
+ #if $idata["ipv6_address"] != "" or $ipv6_autoconfiguration == True
|
|
|
1330ca |
+ #set $enableipv6 = True
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+
|
|
|
1330ca |
#end for
|
|
|
1330ca |
## end looping through the interfaces to see which ones we need to configure.
|
|
|
1330ca |
## =============================================================================
|
|
|
1330ca |
@@ -64,22 +71,56 @@ mv /etc/sysconfig/network.cobbler /etc/s
|
|
|
1330ca |
# connecting to Puppet before a reboot).
|
|
|
1330ca |
/bin/hostname $hostname
|
|
|
1330ca |
#end if
|
|
|
1330ca |
+
|
|
|
1330ca |
+ #if $enableipv6 == True
|
|
|
1330ca |
+grep -v NETWORKING_IPV6 /etc/sysconfig/network > /etc/sysconfig/network.cobbler
|
|
|
1330ca |
+echo "NETWORKING_IPV6=yes" >> /etc/sysconfig/network.cobbler
|
|
|
1330ca |
+rm -f /etc/sysconfig/network
|
|
|
1330ca |
+mv /etc/sysconfig/network.cobbler /etc/sysconfig/network
|
|
|
1330ca |
+
|
|
|
1330ca |
+ #if $ipv6_autoconfiguration != ""
|
|
|
1330ca |
+grep -v IPV6_AUTOCONF /etc/sysconfig/network > /etc/sysconfig/network.cobbler
|
|
|
1330ca |
+ #if $ipv6_autoconfiguration == True
|
|
|
1330ca |
+echo "IPV6_AUTOCONF=yes" >> /etc/sysconfig/network.cobbler
|
|
|
1330ca |
+ #else
|
|
|
1330ca |
+echo "IPV6_AUTOCONF=no" >> /etc/sysconfig/network.cobbler
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+rm -f /etc/sysconfig/network
|
|
|
1330ca |
+mv /etc/sysconfig/network.cobbler /etc/sysconfig/network
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+
|
|
|
1330ca |
+ #if $ipv6_default_device != ""
|
|
|
1330ca |
+grep -v IPV6_DEFAULTDEV /etc/sysconfig/network > /etc/sysconfig/network.cobbler
|
|
|
1330ca |
+echo "IPV6_DEFAULTDEV=$ipv6_default_device" >> /etc/sysconfig/network.cobbler
|
|
|
1330ca |
+rm -f /etc/sysconfig/network
|
|
|
1330ca |
+mv /etc/sysconfig/network.cobbler /etc/sysconfig/network
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+
|
|
|
1330ca |
## =============================================================================
|
|
|
1330ca |
## now create the config file for each interface
|
|
|
1330ca |
#for $iname in $ikeys
|
|
|
1330ca |
# Start configuration for $iname
|
|
|
1330ca |
## create lots of variables to use later
|
|
|
1330ca |
- #set $idata = $interfaces[$iname]
|
|
|
1330ca |
- #set $mac = $idata["mac_address"].upper()
|
|
|
1330ca |
- #set $static = $idata["static"]
|
|
|
1330ca |
- #set $ip = $idata["ip_address"]
|
|
|
1330ca |
- #set $netmask = $idata["subnet"]
|
|
|
1330ca |
- #set $static_routes = $idata["static_routes"]
|
|
|
1330ca |
- #set $bonding = $idata["bonding"]
|
|
|
1330ca |
- #set $bonding_master = $idata["bonding_master"]
|
|
|
1330ca |
- #set $bonding_opts = $idata["bonding_opts"]
|
|
|
1330ca |
- #set $devfile = "/etc/sysconfig/network-scripts/cobbler/ifcfg-" + $iname
|
|
|
1330ca |
- #set $routesfile = "/etc/sysconfig/network-scripts/cobbler/route-" + $iname
|
|
|
1330ca |
+ #set $idata = $interfaces[$iname]
|
|
|
1330ca |
+ #set $mac = $idata["mac_address"].upper()
|
|
|
1330ca |
+ #set $mtu = $idata["mtu"]
|
|
|
1330ca |
+ #set $static = $idata["static"]
|
|
|
1330ca |
+ #set $ip = $idata["ip_address"]
|
|
|
1330ca |
+ #set $netmask = $idata["subnet"]
|
|
|
1330ca |
+ #set $static_routes = $idata["static_routes"]
|
|
|
1330ca |
+ #set $bonding = $idata["bonding"]
|
|
|
1330ca |
+ #set $bonding_master = $idata["bonding_master"]
|
|
|
1330ca |
+ #set $bonding_opts = $idata["bonding_opts"]
|
|
|
1330ca |
+ #set $ipv6_address = $idata["ipv6_address"]
|
|
|
1330ca |
+ #set $ipv6_secondaries = $idata["ipv6_secondaries"]
|
|
|
1330ca |
+ #set $ipv6_mtu = $idata["ipv6_mtu"]
|
|
|
1330ca |
+ #set $ipv6_default_gateway = $idata["ipv6_default_gateway"]
|
|
|
1330ca |
+ #set $ipv6_static_routes = $idata["ipv6_static_routes"]
|
|
|
1330ca |
+ #set $devfile = "/etc/sysconfig/network-scripts/cobbler/ifcfg-" + $iname
|
|
|
1330ca |
+ #set $routesfile = "/etc/sysconfig/network-scripts/cobbler/route-" + $iname
|
|
|
1330ca |
+ #set $ipv6_routesfile = "/etc/sysconfig/network-scripts/cobbler/route6-" + $iname
|
|
|
1330ca |
## determine if this interface is for a VLAN
|
|
|
1330ca |
#if $vlanpattern.match($iname)
|
|
|
1330ca |
## If this is a VLAN interface, skip it, anaconda doesn't know
|
|
|
1330ca |
@@ -140,9 +181,37 @@ echo "NETMASK=$netmask" >> $devfile
|
|
|
1330ca |
## we don't have enough info for static configuration
|
|
|
1330ca |
echo "BOOTPROTO=none" >> $devfile
|
|
|
1330ca |
#end if
|
|
|
1330ca |
+ #if $enableipv6 == True and $ipv6_address == "" and $ipv6_secondaries == ""
|
|
|
1330ca |
+echo "IPV6INIT=no" >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #if $enableipv6 == True and $ipv6_autoconfiguration == False
|
|
|
1330ca |
+ #if $ipv6_address != ""
|
|
|
1330ca |
+echo "IPV6INIT=yes" >> $devfile
|
|
|
1330ca |
+echo "IPV6ADDR=$ipv6_address" >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #if $ipv6_secondaries != ""
|
|
|
1330ca |
+ #set ipv6_secondaries = ' '.join(ipv6_secondaries)
|
|
|
1330ca |
+ ## The quotes around the ipv6 ip's need to be here
|
|
|
1330ca |
+echo 'IPV6ADDR_SECONDARIES="$ipv6_secondaries"' >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #if $ipv6_mtu != ""
|
|
|
1330ca |
+echo "IPV6MTU=$ipv6_mtu" >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #if $ipv6_default_gateway != ""
|
|
|
1330ca |
+echo "IPV6_DEFAULTGW=$ipv6_default_gateway" >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
#else
|
|
|
1330ca |
+ #if $ip == ""
|
|
|
1330ca |
+ ## this interface has no IPv4 address set
|
|
|
1330ca |
+echo "BOOTPROTO=none" >> $devfile
|
|
|
1330ca |
+ #else
|
|
|
1330ca |
## this is a DHCP interface, much less work to do
|
|
|
1330ca |
echo "BOOTPROTO=dhcp" >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #if $mtu != ""
|
|
|
1330ca |
+echo "MTU=$mtu" >> $devfile
|
|
|
1330ca |
#end if
|
|
|
1330ca |
#else if $is_vlan == "true" or $bonding.lower() == "master"
|
|
|
1330ca |
## Handle non-physical interfaces with special care. :)
|
|
|
1330ca |
@@ -178,6 +247,9 @@ echo "BOOTPROTO=none" >> $devfile
|
|
|
1330ca |
#else
|
|
|
1330ca |
echo "BOOTPROTO=dhcp" >> $devfile
|
|
|
1330ca |
#end if
|
|
|
1330ca |
+ #if $mtu != ""
|
|
|
1330ca |
+echo "MTU=$mtu" >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
#else if $configbymac == False
|
|
|
1330ca |
## We'll end up here when not all physical interfaces present for
|
|
|
1330ca |
## this system have MAC-addresses configured for them. We don't
|
|
|
1330ca |
@@ -214,6 +286,9 @@ echo "BOOTPROTO=none" >> $devfile
|
|
|
1330ca |
## this is a DHCP interface, much less work to do
|
|
|
1330ca |
echo "BOOTPROTO=dhcp" >> $devfile
|
|
|
1330ca |
#end if
|
|
|
1330ca |
+ #if $mtu != ""
|
|
|
1330ca |
+echo "MTU=$mtu" >> $devfile
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
#else
|
|
|
1330ca |
# If you end up here, please mail the list... This shouldn't
|
|
|
1330ca |
# happen. ;-) -- jcapel
|
|
|
1330ca |
@@ -225,19 +300,32 @@ echo "BOOTPROTO=dhcp" >> $devfile
|
|
|
1330ca |
#set $nct = $nct + 1
|
|
|
1330ca |
echo "DNS$nct=$nameserver" >> $devfile
|
|
|
1330ca |
#end for
|
|
|
1330ca |
- #end if
|
|
|
1330ca |
- #for $route in $static_routes
|
|
|
1330ca |
- #set routepattern = $re.compile("[0-9/.]+:[0-9.]+")
|
|
|
1330ca |
- #if $routepattern.match($route)
|
|
|
1330ca |
- #set $routebits = $route.split(":")
|
|
|
1330ca |
- #set [$network, $router] = $route.split(":")
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #for $route in $static_routes
|
|
|
1330ca |
+ #set routepattern = $re.compile("[0-9/.]+:[0-9.]+")
|
|
|
1330ca |
+ #if $routepattern.match($route)
|
|
|
1330ca |
+ #set $routebits = $route.split(":")
|
|
|
1330ca |
+ #set [$network, $router] = $route.split(":")
|
|
|
1330ca |
echo "$network via $router" >> $routesfile
|
|
|
1330ca |
- #else
|
|
|
1330ca |
+ #else
|
|
|
1330ca |
+ # Warning: invalid route "$route"
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
+ #end for
|
|
|
1330ca |
+ #if $enableipv6 == True
|
|
|
1330ca |
+ #for $route in $ipv6_static_routes
|
|
|
1330ca |
+ #set routepattern = $re.compile("[0-9a-fA-F:/]+,[0-9a-fA-F:]+")
|
|
|
1330ca |
+ #if $routepattern.match($route)
|
|
|
1330ca |
+ #set $routebits = $route.split(",")
|
|
|
1330ca |
+ #set [$network, $router] = $route.split(",")
|
|
|
1330ca |
+echo "$network via $router dev $iname" >> $ipv6_routesfile
|
|
|
1330ca |
+ #else
|
|
|
1330ca |
# Warning: invalid route "$route"
|
|
|
1330ca |
#end if
|
|
|
1330ca |
#end for
|
|
|
1330ca |
+ #end if
|
|
|
1330ca |
#set $i = $i + 1
|
|
|
1330ca |
# End configuration for $iname
|
|
|
1330ca |
+
|
|
|
1330ca |
#end for
|
|
|
1330ca |
## =============================================================================
|
|
|
1330ca |
## Configure name server search path in /etc/resolv.conf
|
|
|
1330ca |
|