|
|
1070a0 |
--- cobbler-2.0.7/snippets/post_install_network_config.org 2017-10-31 11:57:38.783714163 +0100
|
|
|
1070a0 |
+++ cobbler-2.0.7/snippets/post_install_network_config 2017-10-31 12:11:05.663448156 +0100
|
|
|
1070a0 |
@@ -21,18 +21,18 @@
|
|
|
1070a0 |
#set $idata = $interfaces[$iname]
|
|
|
1070a0 |
## do not configure by mac address if we don't have one AND it's not for bonding/vlans
|
|
|
1070a0 |
## as opposed to a "real" physical interface
|
|
|
1070a0 |
- #if $idata["mac_address"] == "" and not $vlanpattern.match($iname) and not $idata["bonding"].lower() == "master":
|
|
|
1070a0 |
+ #if $idata.get("mac_address", "") == "" and not $vlanpattern.match($iname) and not $idata.get("bonding", "").lower() == "master":
|
|
|
1070a0 |
## we have to globally turn off the config by mac feature as we can't
|
|
|
1070a0 |
## use it now
|
|
|
1070a0 |
#set $configbymac = False
|
|
|
1070a0 |
#end if
|
|
|
1070a0 |
## count the number of bonding devices we have.
|
|
|
1070a0 |
- #if $idata["bonding"].lower() == "master"
|
|
|
1070a0 |
+ #if $idata.get("bonding", "").lower() == "master"
|
|
|
1070a0 |
#set $numbondingdevs += 1
|
|
|
1070a0 |
#end if
|
|
|
1070a0 |
|
|
|
1070a0 |
## enable IPv6 networking if we set an ipv6 address or turn on autoconfiguration
|
|
|
1070a0 |
- #if $idata["ipv6_address"] != "" or $ipv6_autoconfiguration == True
|
|
|
1070a0 |
+ #if $idata.get("ipv6_address", "") != "" or $ipv6_autoconfiguration == True
|
|
|
1070a0 |
#set $enableipv6 = True
|
|
|
1070a0 |
#end if
|
|
|
1070a0 |
|
|
|
1070a0 |
@@ -110,20 +110,20 @@ mv /etc/sysconfig/network.cobbler /etc/s
|
|
|
1070a0 |
# Start configuration for $iname
|
|
|
1070a0 |
## create lots of variables to use later
|
|
|
1070a0 |
#set $idata = $interfaces[$iname]
|
|
|
1070a0 |
- #set $mac = $idata["mac_address"].upper()
|
|
|
1070a0 |
- #set $mtu = $idata["mtu"]
|
|
|
1070a0 |
- #set $static = $idata["static"]
|
|
|
1070a0 |
- #set $ip = $idata["ip_address"]
|
|
|
1070a0 |
- #set $netmask = $idata["subnet"]
|
|
|
1070a0 |
- #set $static_routes = $idata["static_routes"]
|
|
|
1070a0 |
- #set $bonding = $idata["bonding"]
|
|
|
1070a0 |
- #set $bonding_master = $idata["bonding_master"]
|
|
|
1070a0 |
- #set $bonding_opts = $idata["bonding_opts"]
|
|
|
1070a0 |
- #set $ipv6_address = $idata["ipv6_address"]
|
|
|
1070a0 |
- #set $ipv6_secondaries = $idata["ipv6_secondaries"]
|
|
|
1070a0 |
- #set $ipv6_mtu = $idata["ipv6_mtu"]
|
|
|
1070a0 |
- #set $ipv6_default_gateway = $idata["ipv6_default_gateway"]
|
|
|
1070a0 |
- #set $ipv6_static_routes = $idata["ipv6_static_routes"]
|
|
|
1070a0 |
+ #set $mac = $idata.get("mac_address", "").upper()
|
|
|
1070a0 |
+ #set $mtu = $idata.get("mtu", "")
|
|
|
1070a0 |
+ #set $static = $idata.get("static", "")
|
|
|
1070a0 |
+ #set $ip = $idata.get("ip_address", "")
|
|
|
1070a0 |
+ #set $netmask = $idata.get("subnet", "")
|
|
|
1070a0 |
+ #set $static_routes = $idata.get("static_routes", "")
|
|
|
1070a0 |
+ #set $bonding = $idata.get("bonding", "")
|
|
|
1070a0 |
+ #set $bonding_master = $idata.get("bonding_master", "")
|
|
|
1070a0 |
+ #set $bonding_opts = $idata.get("bonding_opts", "")
|
|
|
1070a0 |
+ #set $ipv6_address = $idata.get("ipv6_address", "")
|
|
|
1070a0 |
+ #set $ipv6_secondaries = $idata.get("ipv6_secondaries", "")
|
|
|
1070a0 |
+ #set $ipv6_mtu = $idata.get("ipv6_mtu", "")
|
|
|
1070a0 |
+ #set $ipv6_default_gateway = $idata.get("ipv6_default_gateway", "")
|
|
|
1070a0 |
+ #set $ipv6_static_routes = $idata.get("ipv6_static_routes", "")
|
|
|
1070a0 |
#set $devfile = "/etc/sysconfig/network-scripts/cobbler/ifcfg-" + $iname
|
|
|
1070a0 |
#set $routesfile = "/etc/sysconfig/network-scripts/cobbler/route-" + $iname
|
|
|
1070a0 |
#set $ipv6_routesfile = "/etc/sysconfig/network-scripts/cobbler/route6-" + $iname
|