]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/ganeti2/templates/instance-debootstrap/hooks/00-dsa-configure-networking.erb
add ganeti3 cluster
[dsa-puppet.git] / modules / ganeti2 / templates / instance-debootstrap / hooks / 00-dsa-configure-networking.erb
index 15c5c070d1861bbfa4c5bc2226eecd45aaf81cc7..e06ecfff0de90688f137b32d09341188fb385e03 100755 (executable)
@@ -36,11 +36,12 @@ auto lo
 iface lo inet loopback
 
 EOF
+fi
 
 
 ###########################################
 ###########################################
-<% if scope.lookupvar('::cluster') == 'ganeti2.debian.org' -%>
+<% if scope.lookupvar('::cluster').to_s == 'ganeti2.debian.org' -%>
 
 ###########################################
 if [ "$NIC_COUNT" -ge 1 ]; then
@@ -70,7 +71,7 @@ EOF
 
 ###########################################
 ###########################################
-<% elif scope.lookupvar('::cluster') == 'ganeti-osuosl.debian.org' -%>
+<% elsif scope.lookupvar('::cluster').to_s == 'ganeti-osuosl.debian.org' -%>
 #
 ###########################################
 if [ "$NIC_COUNT" -ge 1 ]; then
@@ -94,8 +95,34 @@ nameserver 140.211.166.130
 nameserver 140.211.166.131
 EOF
 
+<% elsif scope.lookupvar('::cluster').to_s == 'ganeti3.debian.org' -%>
+#
+###########################################
+if [ "$NIC_COUNT" -ge 1 ]; then
+  cat >> $TARGET/etc/network/interfaces << EOF
+auto eth0
+iface eth0 inet static
+  address ${NIC_0_IP}
+  netmask 255.255.255.192
+  gateway 82.195.75.126
+
+  pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true
+EOF
+
+fi
+
+###########################################
+cat > $TARGET/etc/resolv.conf <<EOF
+# /etc/resolv.conf
+search debian.org
+nameserver 82.195.75.81
+nameserver 82.195.66.239
+nameserver 217.198.242.225
+EOF
+
 <% else -%>
 
+# No config for cluster <%= scope.lookupvar('::cluster').to_s %>
 cp /etc/resolv.conf $TARGET/etc/resolv.conf
 
 <% end -%>