aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tools/setup_openstack.sh
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2017-07-26 16:06:35 -0500
committerVictor Morales <victor.morales@intel.com>2017-07-26 16:06:35 -0500
commitdd074806ad51761392a9cca3f1f04fbbebd3de22 (patch)
tree9088768b55bf307875369e7368f56c7e66149424 /bootstrap/vagrant-onap/tools/setup_openstack.sh
parent8805879b4dc92014381ba55b75955b295944ded6 (diff)
Sync latest changes for vagrant-onap
Given some internal procedures was not possible to submit all the changes. In the meantime, those changes were placed into an non-official project. This change syncronizes the latest changes into the official repository. Issue-id: INT-17 Change-Id: Ia4125f4b70273401e4ed3cc1908d2e2ad7d1c2e9 Signed-off-by: Victor Morales <victor.morales@intel.com>
Diffstat (limited to 'bootstrap/vagrant-onap/tools/setup_openstack.sh')
-rwxr-xr-xbootstrap/vagrant-onap/tools/setup_openstack.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/bootstrap/vagrant-onap/tools/setup_openstack.sh b/bootstrap/vagrant-onap/tools/setup_openstack.sh
new file mode 100755
index 000000000..765ad9446
--- /dev/null
+++ b/bootstrap/vagrant-onap/tools/setup_openstack.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+ubuntu_name=${OS_IMAGE:-"trusty-server-cloudimg-amd64-disk1"}
+export OS_IMAGE=$ubuntu_name
+ubuntu_glance=`openstack image list -c Name -f value | grep "$ubuntu_name"`
+ubuntu_file=/tmp/ubuntu.img
+
+sec_group_name=${OS_SEC_GROUP:-"onap-ssh-secgroup"}
+export OS_SEC_GROUP=$sec_group_name
+sec_group_list=`openstack security group list -c Name -f value | grep "$sec_group_name"`
+
+if [[ -z $ubuntu_glance ]]; then
+ if [ ! -f $ubuntu_file ]; then
+ curl http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img -o "$ubuntu_file"
+ fi
+
+ openstack image create --disk-format raw --container-format bare --public --file $ubuntu_file "$ubuntu_name"
+fi
+
+if [[ -z $sec_group_list ]]; then
+ openstack security group create "$sec_group_name"
+ openstack security group rule create --protocol tcp --remote-ip 0.0.0.0/0 --dst-port 22:22 "$sec_group_name"
+fi