summaryrefslogtreecommitdiffstats
path: root/snippets
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-12-17 14:41:15 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-12-17 14:41:15 -0500
commitc25e68d42145216d988f52b720e4d0a7727f5c68 (patch)
treec0333dff468b36d3f2e6b026c0414a24f4740ba9 /snippets
parent47ff5eb5390b699f615f7dd37b908fa23c3a4b26 (diff)
downloadcobbler-c25e68d42145216d988f52b720e4d0a7727f5c68.tar.gz
cobbler-c25e68d42145216d988f52b720e4d0a7727f5c68.tar.xz
cobbler-c25e68d42145216d988f52b720e4d0a7727f5c68.zip
Remove pre-spacing from snippet now to make the output more readable
Diffstat (limited to 'snippets')
-rw-r--r--snippets/post_install_network_config112
1 files changed, 56 insertions, 56 deletions
diff --git a/snippets/post_install_network_config b/snippets/post_install_network_config
index 6f4e7ab5..f6170283 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -34,22 +34,22 @@
#set $i = 0
## setup bonding if we have to
#if $numbondingdevs > 0
- if [-x "/etc/modprobe.conf"]; then;
- echo "options bonding max_bonds=$numbondingdevs" >> /etc/modprobe.conf
- fi
+if [-x "/etc/modprobe.conf"]; then;
+ echo "options bonding max_bonds=$numbondingdevs" >> /etc/modprobe.conf
+fi
#end if
## =============================================================================
## create a staging directory to build out our network scripts into
## make sure we preserve the loopback device
- mkdir /etc/sysconfig/network-scripts/cobbler
- cp /etc/sysconfig/network-scripts/ifcfg-lo /etc/sysconfig/network-scripts/cobbler/
+mkdir /etc/sysconfig/network-scripts/cobbler
+cp /etc/sysconfig/network-scripts/ifcfg-lo /etc/sysconfig/network-scripts/cobbler/
## =============================================================================
## configure the gateway if set up (this is global, not a per-interface setting)
#if $gateway != ""
- grep -v GATEWAY /etc/sysconfig/network > /etc/sysconfig/network.cobbler
- echo "GATEWAY=$gateway" >> /etc/sysconfig/network.cobbler
- rm -f /etc/sysconfig/network
- mv /etc/sysconfig/network.cobbler /etc/sysconfig/network
+grep -v GATEWAY /etc/sysconfig/network > /etc/sysconfig/network.cobbler
+echo "GATEWAY=$gateway" >> /etc/sysconfig/network.cobbler
+rm -f /etc/sysconfig/network
+mv /etc/sysconfig/network.cobbler /etc/sysconfig/network
#end if
## =============================================================================
## now create the config file for each interface
@@ -78,122 +78,122 @@
## if this is a bonded interface, configure it in modprobe.conf
#if $bonding.lower() == "master"
## Add required entry to modprobe.conf
- if [-x "/etc/modprobe.conf"]; then
- echo "alias $iname bonding" >> /etc/modprobe.conf.cobbler
- fi
+if [-x "/etc/modprobe.conf"]; then
+ echo "alias $iname bonding" >> /etc/modprobe.conf.cobbler
+fi
#end if
#if $configbymac and $is_vlan == "false" and $bonding.lower() != "master"
## This is the code path physical interfaces will follow.
## Get the current interface name
- IFNAME=\$(ifconfig -a | grep -i '$mac' | cut -d ' ' -f 1)
+IFNAME=\$(ifconfig -a | grep -i '$mac' | cut -d ' ' -f 1)
## Rename this interface in modprobe.conf
## FIXME: if both interfaces startwith eth this is wrong
- if [-x "/etc/modprobe.conf"]; then;
- grep \$IFNAME /etc/modprobe.conf | sed "s/\$IFNAME/$iname/" >> /etc/modprobe.conf.cobbler
- grep -v \$IFNAME /etc/modprobe.conf >> /etc/modprobe.conf.new
- rm -f /etc/modprobe.conf
- mv /etc/modprobe.conf.new /etc/modprobe.conf
- fi
- echo "DEVICE=$iname" > $devfile
- echo "HWADDR=$mac" >> $devfile
- echo "ONBOOT=yes" >> $devfile
+if [-x "/etc/modprobe.conf"]; then;
+ grep \$IFNAME /etc/modprobe.conf | sed "s/\$IFNAME/$iname/" >> /etc/modprobe.conf.cobbler
+ grep -v \$IFNAME /etc/modprobe.conf >> /etc/modprobe.conf.new
+ rm -f /etc/modprobe.conf
+ mv /etc/modprobe.conf.new /etc/modprobe.conf
+fi
+echo "DEVICE=$iname" > $devfile
+echo "HWADDR=$mac" >> $devfile
+echo "ONBOOT=yes" >> $devfile
#if $bonding.lower() == "slave" and $bonding_master != ""
## if needed setup bonding
- echo "SLAVE=yes" >> $devfile
- echo "MASTER=$bonding_master" >> $devfile
+echo "SLAVE=yes" >> $devfile
+echo "MASTER=$bonding_master" >> $devfile
## see Red Hat bugzilla 442339
- echo "HOTPLUG=no" >> $devfile
+echo "HOTPLUG=no" >> $devfile
#end if
#if $static.lower() == "true" or $bonding.lower() == "slave"
## for static or slave interfaces
#if $ip != "" and $bonding.lower() != "slave"
## Only configure static networking if an IP-address is
## configured
- echo "BOOTPROTO=static" >> $devfile
- echo "IPADDR=$ip" >> $devfile
+echo "BOOTPROTO=static" >> $devfile
+echo "IPADDR=$ip" >> $devfile
#if $netmask == ""
## Default to 255.255.255.0?
#set $netmask = "255.255.255.0"
#end if
- echo "NETMASK=$netmask" >> $devfile
+echo "NETMASK=$netmask" >> $devfile
#else
## Leave the interface unconfigured
## we don't have enough info for static configuration
- echo "BOOTPROTO=none" >> $devfile
+echo "BOOTPROTO=none" >> $devfile
#end if
#else
## this is a DHCP interface, much less work to do
- echo "BOOTPROTO=dhcp" >> $devfile
+echo "BOOTPROTO=dhcp" >> $devfile
#end if
#else if $is_vlan == "true" or $bonding.lower() == "master"
## Handle non-physical interfaces with special care. :)
- echo "# Cobbler generated non-physical interface" > $devfile
- echo "DEVICE=$iname" >> $devfile
+echo "# Cobbler generated non-physical interface" > $devfile
+echo "DEVICE=$iname" >> $devfile
#if $is_vlan == "true"
## configure vlan if required
- echo "VLAN=yes" >> $devfile
+echo "VLAN=yes" >> $devfile
#end if
#if $bonding.lower() == "master" and $bonding_opts != ""
## configure bonding if required
- cat >> $devfile << EOF
- BONDING_OPTS="$bonding_opts"
- EOF
+cat >> $devfile << EOF
+BONDING_OPTS="$bonding_opts"
+EOF
#end if
- echo "ONPARENT=yes" >> $devfile
+echo "ONPARENT=yes" >> $devfile
#if $static.lower() == "true"
## for static non-physical interfaces...
#if $ip != ""
## Only configure static networking if an IP-address is
## configured
- echo "BOOTPROTO=static" >> $devfile
- echo "IPADDR=$ip" >> $devfile
+echo "BOOTPROTO=static" >> $devfile
+echo "IPADDR=$ip" >> $devfile
#if $netmask == ""
## Default to 255.255.255.0?
#set $netmask = "255.255.255.0"
#end if
- echo "NETMASK=$netmask" >> $devfile
+echo "NETMASK=$netmask" >> $devfile
#else
## Leave the interface unconfigured
- echo "BOOTPROTO=none" >> $devfile
+echo "BOOTPROTO=none" >> $devfile
#end if
#else
- echo "BOOTPROTO=dhcp" >> $devfile
+echo "BOOTPROTO=dhcp" >> $devfile
#end if
#else if $configbymac == False
## We'll end up here when not all physical interfaces present for
## this system have MAC-addresses configured for them. We don't
## support interface renaming here.
- MAC=\$(ifconfig -a | grep $iname | awk '{ print \$5 }')
- echo "DEVICE=$iname" > $devfile
- echo "HWADDR=\$MAC" >> $devfile
- echo "ONBOOT=yes" >> $devfile
+MAC=\$(ifconfig -a | grep $iname | awk '{ print \$5 }')
+echo "DEVICE=$iname" > $devfile
+echo "HWADDR=\$MAC" >> $devfile
+echo "ONBOOT=yes" >> $devfile
#if $bonding.lower() == "slave" and $bonding_master != ""
## if needed setup bonding
- echo "SLAVE=yes" >> $devfile
- echo "MASTER=$bonding_master" >> $devfile
+echo "SLAVE=yes" >> $devfile
+echo "MASTER=$bonding_master" >> $devfile
## see Red Hat bugzilla 442339
- echo "HOTPLUG=no" >> $devfile
+echo "HOTPLUG=no" >> $devfile
#end if
#if $static.lower() == "true" or $bonding.lower() == "slave"
## for static or slave interfaces
#if $ip != "" and $bonding.lower() != "slave"
## Only configure static networking if an IP-address is
## configured
- echo "BOOTPROTO=static" >> $devfile
- echo "IPADDR=$ip" >> $devfile
+echo "BOOTPROTO=static" >> $devfile
+echo "IPADDR=$ip" >> $devfile
#if $netmask == ""
## Default to 255.255.255.0?
#set $netmask = "255.255.255.0"
#end if
- echo "NETMASK=$netmask" >> $devfile
+echo "NETMASK=$netmask" >> $devfile
#else
## Leave the interface unconfigured
## we don't have enough info for static configuration
- echo "BOOTPROTO=none" >> $devfile
+echo "BOOTPROTO=none" >> $devfile
#end if
#else
## this is a DHCP interface, much less work to do
- echo "BOOTPROTO=dhcp" >> $devfile
+echo "BOOTPROTO=dhcp" >> $devfile
#end if
#else
# If you end up here, please mail the list... This shouldn't
@@ -202,14 +202,14 @@
#set $nct = 0
#for $nameserver in $name_servers
#set $ct = $nct + 1
- echo "DNS$ct=$nameserver" >> $devfile
+echo "DNS$ct=$nameserver" >> $devfile
#end for
#for $route in $static_routes
#set routepattern = $re.compile("[0-9/.]+:[0-9.]+")
#if $routepattern.match($route)
#set $routebits = $route.split(":")
#set [$network, $router] = $route.split(":")
- echo "$network via $router" >> $routesfile
+echo "$network via $router" >> $routesfile
#else
# Warning: invalid route "$route"
#end if