/[sysadmin-cookbook]/recepies/ganeti/migrate-lxc/B-ganeti-network-interfaces.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /recepies/ganeti/migrate-lxc/B-ganeti-network-interfaces.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 316 - (show annotations)
Thu Apr 24 07:26:24 2014 UTC (10 years ago) by dpavlin
File MIME type: application/x-sh
File size: 845 byte(s)
split master and storage node, support machines with dash in name

1 #!/bin/sh -xe
2
3 . ./0-host.sh
4 . ./0-lxc.sh
5 . ./0-ganeti.sh
6
7 ssh_lxc cat /var/lib/lxc/$host/config | grep ipv4 | tee $host/ipv4
8 public_ip=`grep 193.198 $host/ipv4 | cut -d= -f2 | cut -d/ -f1 | sed 's/ *//'`
9 local_ip=` grep 10.60 $host/ipv4 | cut -d= -f2 | cut -d/ -f1 | sed 's/ *//'`
10
11 tee /tmp/network-interfaces-$host << __INTERFACES__
12 auto eth0 eth1 lo
13
14 iface lo inet loopback
15
16 iface eth0 inet static
17 address $public_ip
18 netmask 255.255.254.0
19 gateway 193.198.212.1
20
21 iface eth1 inet static
22 address $local_ip
23 netmask 255.255.254.0
24 __INTERFACES__
25
26 # this will backup file on original machine which is still running!
27 ping -c 1 $host && ssh_storage chroot /tmp/$host bak add,commit /etc/network/interfaces
28
29 scp /tmp/network-interfaces-$host root@$storage:/tmp/
30
31 ssh_storage mv -v /tmp/network-interfaces-$host /tmp/$host/etc/network/interfaces

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26