blob: 38a050d8d92833c6ee02b604fe80329188d13989 [file] [log] [blame]
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -04001#!/bin/bash
2
3# This script is for development use. It copies all of the
4# required files and directories to the installer VM to
5# allow changes to be made without having to rebuild the
6# VM and it's registry which is time consuming.
7
8# usage devCopyTiInstaller.sh <ip-address>
9
Sergio Slobodrian7c483622017-06-13 15:51:34 -040010uId=`id -u`
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -040011
Sergio Slobodrianc5477712017-06-07 11:56:56 -040012sed -i -e '/^#/!d' install.cfg
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -040013rm -fr .test
14mkdir .test
15hosts=""
Sergio Slobodrian7c483622017-06-13 15:51:34 -040016for i in `virsh list | awk '{print $2}' | grep ha-serv${uId}-`
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -040017do
18 ipAddr=`virsh domifaddr $i | tail -n +3 | head -n 1 | awk '{print $4}' | sed -e 's~/.*~~'`
19 hosts="$hosts $ipAddr"
20 hName=`echo $i | sed -e 's/install_//'`
21 cat .vagrant/machines/$hName/libvirt/private_key > .test/$ipAddr
22done
23echo "hosts=\"$hosts\"" >> install.cfg
Sergio Slobodrianc5477712017-06-07 11:56:56 -040024echo 'iUser="vagrant"' >> install.cfg