diff options
author | Jerry Zhao <zhaoxinyu@huawei.com> | 2015-04-11 08:21:10 +0800 |
---|---|---|
committer | Jerry Zhao <zhaoxinyu@huawei.com> | 2015-04-20 20:46:01 +0800 |
commit | 77bf95508534a744c4b6e7b5635ec1e8eb294098 (patch) | |
tree | 38ed362a6a88b7bc7e010a6614f0de6146a5920a /compass/deploy/prepare.sh | |
parent | e1d29739ccbc6efc20f400636a211dae0e75bff4 (diff) |
first commit of deploy.sh for compass
with deploy.sh in this patch, a compass vagrant box
will be spawned along with 5 libvirt vms. compass api
will be called to install ubuntu 14.04 on those libvirt vms.
in a patch later, openstack will be configured to be installed.
JIRA: BGS-28
Change-Id: Ie5f8442331081289a1a81a8e3295c881b0504c3c
Signed-off-by: Jerry Zhao <zhaoxinyu@huawei.com>
Diffstat (limited to 'compass/deploy/prepare.sh')
-rw-r--r-- | compass/deploy/prepare.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/compass/deploy/prepare.sh b/compass/deploy/prepare.sh new file mode 100644 index 0000000..2086c5d --- /dev/null +++ b/compass/deploy/prepare.sh @@ -0,0 +1,35 @@ +sudo apt-get update -y +sudo apt-get install git python-pip python-dev -y +vagrant --version +if [[ $? != 0 ]]; then + vagrant_pkg_url=https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.deb + wget ${vagrant_pkg_url} + sudo dpkg -i $(basename ${vagrant_pkg_url}) +else + echo "vagrant is already installed" +fi +sudo apt-get install libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev -y +sudo service libvirt-bin restart + +for plugin in vagrant-libvirt vagrant-mutate; do + vagrant plugin list |grep $plugin + if [[ $? != 0 ]]; then + vagrant plugin install $plugin --plugin-source https://ruby.taobao.org + else + echo "$plugin plugin is already installed" + fi +done +sudo pip install --upgrade ansible virtualenv +#precise_box_vb_url=https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box +#precise_box_vb_filename=$(basename ${precise_box_vb_url}) +centos65_box_vb_url=https://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.5-x86_64-v20140504.box +centos65_box_vb_filename=$(basename ${centos65_box_vb_url}) +#wget ${precise_box_vb_url} +vagrant box list |grep centos65 +if [[ $? != 0 ]]; then + wget ${centos65_box_vb_url} + mv ${centos65_box_vb_filename} centos65.box + vagrant mutate centos65.box libvirt +else + echo "centos65 box already exists" +fi |