/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 316 - (hide 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 dpavlin 306 #!/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 dpavlin 312 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 dpavlin 306
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 dpavlin 316 ping -c 1 $host && ssh_storage chroot /tmp/$host bak add,commit /etc/network/interfaces
28 dpavlin 306
29 dpavlin 316 scp /tmp/network-interfaces-$host root@$storage:/tmp/
30 dpavlin 306
31 dpavlin 316 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