5 if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
6 echo "Missing target directory"
10 if [ ! -d "$TARGET/etc/network" ]; then
11 echo "Missing target network directory"
15 if [ -z "$NIC_COUNT" ]; then
16 echo "Missing NIC COUNT"
20 rm -f $TARGET/etc/udev/rules.d/70-persistent-net.rules
22 touch $TARGET/etc/udev/rules.d/75-cd-aliases-generator.rules
23 touch $TARGET/etc/udev/rules.d/75-persistent-net-generator.rules
26 ###########################################
27 fqdn=$(cat $TARGET/etc/hostname)
28 echo ${fqdn%%.*} > $TARGET/etc/hostname
30 ###########################################
31 if [ "$NIC_COUNT" -ge 1 ]; then
32 cat > $TARGET/etc/network/interfaces << EOF
33 # /etc/network/interfaces
36 iface lo inet loopback
42 ###########################################
43 ###########################################
44 <% if scope.lookupvar('::cluster').to_s == 'ganeti2.debian.org' -%>
46 ###########################################
47 if [ "$NIC_COUNT" -ge 1 ]; then
48 cat >> $TARGET/etc/network/interfaces << EOF
50 iface eth0 inet static
55 pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true
56 up ip addr add 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS/64 dev \$IFACE
57 up ip r add default via 2607:f8f0:610:4000::1 src 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS dev \$IFACE
58 down ip r del default via 2607:f8f0:610:4000::1 src 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS dev \$IFACE
59 down ip addr del 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS/64 dev \$IFACE
64 ###########################################
65 cat > $TARGET/etc/resolv.conf <<EOF
67 search debprivate-ubc.debian.org debian.org
68 nameserver 206.12.19.20
69 nameserver 206.12.19.21
72 ###########################################
73 ###########################################
74 <% elsif scope.lookupvar('::cluster').to_s == 'ganeti-osuosl.debian.org' -%>
76 ###########################################
77 if [ "$NIC_COUNT" -ge 1 ]; then
78 cat >> $TARGET/etc/network/interfaces << EOF
80 iface eth0 inet static
82 netmask 255.255.255.128
85 pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true
90 ###########################################
91 cat > $TARGET/etc/resolv.conf <<EOF
94 nameserver 140.211.166.130
95 nameserver 140.211.166.131
98 <% elsif scope.lookupvar('::cluster').to_s == 'ganeti3.debian.org' -%>
100 ###########################################
101 if [ "$NIC_COUNT" -ge 1 ]; then
102 cat >> $TARGET/etc/network/interfaces << EOF
104 iface eth0 inet static
106 netmask 255.255.255.192
107 gateway 82.195.75.126
109 pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true
114 ###########################################
115 cat > $TARGET/etc/resolv.conf <<EOF
118 nameserver 82.195.75.81
119 nameserver 82.195.66.239
120 nameserver 217.198.242.225
125 # No config for cluster <%= scope.lookupvar('::cluster').to_s %>
126 cp /etc/resolv.conf $TARGET/etc/resolv.conf
133 ###########################################
134 if [ "$NIC_COUNT" -ge 2 ]; then
135 cat >> $TARGET/etc/network/interfaces << EOF
138 iface eth1 inet static
140 netmask 255.255.255.0
145 ###########################################
147 cat > $TARGET/etc/hosts << EOF
149 ${NIC_0_IP} ${fqdn} ${fqdn%%.*}
151 # The following lines are desirable for IPv6 capable hosts
152 ::1 ip6-localhost ip6-loopback
154 ff00::0 ip6-mcastprefix
156 ff02::2 ip6-allrouters