]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/ganeti2/templates/instance-debootstrap/hooks/00-dsa-configure-networking.erb
fix 00-dsa-configure-networking script
[dsa-puppet.git] / modules / ganeti2 / templates / instance-debootstrap / hooks / 00-dsa-configure-networking.erb
index 1c3d4856e0b21700ed9f0285eca45090257fb7ef..fe2a281880f6a5979023b179d7b33a52edd58a90 100755 (executable)
@@ -46,6 +46,7 @@ fi
 
 if [ "$NIC_COUNT" -ge 2 ]; then
   cat >> $TARGET/etc/network/interfaces << EOF
+
 auto eth1
 iface eth1 inet static
   address ${NIC_1_IP}
@@ -54,6 +55,8 @@ EOF
 
 fi
 
+fqdn=$(cat $TARGET/etc/hostname)
+echo ${fqdn%%.*} > $TARGET/etc/hostname
 
 cat > $TARGET/etc/resolv.conf <<EOF
 # /etc/resolv.conf
@@ -63,7 +66,7 @@ nameserver 206.12.19.21
 EOF
 
 # clean up etc/hosts
-cat > $TARGET/etc/hosts
+cat > $TARGET/etc/hosts << EOF
 127.0.0.1       localhost
 
 # The following lines are desirable for IPv6 capable hosts