aboutsummaryrefslogtreecommitdiffstats
path: root/juju/adapter.sh
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-01-10 16:11:55 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-01-25 17:34:08 +0800
commit1eb8d4ccfbc9c34723586980d5a912e2ffa903cd (patch)
treeb1764b819ef45ea93b5f263211a736748b7c57c4 /juju/adapter.sh
parent495994be89cc04be704767ed3f6630c6663c11eb (diff)
Opera deploy scripts
JIRA: OPERA-2 Requirement: After compass4nfv deployment Function: 1. Launch a VM (defaultly CentOS 7) 2. Launch Open-O dockers inside VM 3. Launch juju inside openstack Directory conf/ need config according to local environment Change-Id: Iac24051668e15b60f76f4819760f7b7c9b1867f3 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'juju/adapter.sh')
-rwxr-xr-xjuju/adapter.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/juju/adapter.sh b/juju/adapter.sh
new file mode 100755
index 0000000..f4c2d52
--- /dev/null
+++ b/juju/adapter.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+function generate_compass_openrc()
+{
+ ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
+ MGMT_IP=192.168.200.2
+ exec_command="sshpass -p root ssh $ssh_options root@$MGMT_IP"
+
+ RUN_DIR=$(eval "$exec_command ls /var/ansible/run")
+
+ cmd="cat /var/ansible/run/$RUN_DIR/group_vars/all | grep -A 3 public_vip: | sed -n '2p' | sed -e 's/ ip: //g'"
+ PUBLIC_VIP=$(eval "$exec_command $cmd")
+
+ echo -e "export OS_PASSWORD=console \n\
+export OS_TENANT_NAME=admin \n\
+export OS_AUTH_URL=http://$PUBLIC_VIP:35357/v2.0 \n\
+export OS_USERNAME=admin \n\
+export OS_VOLUME_API_VERSION=2 \n\
+export OS_REGION_NAME=RegionOne " > $WORK_DIR/admin-openrc.sh
+
+}