summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2016-05-16 16:11:57 +0800
committerchenshuai@huawei.com <chenshuai@huawei.com>2016-05-16 16:11:57 +0800
commitdcd27eccda9c29a8ce9b3c2804f831317d9ea066 (patch)
tree7ec9c1cafe8b52cab2b498bb151f4b4ae92a4ab9 /deploy
parent962fbfefa11fbd553f7d1c772bdd1dc7b7161043 (diff)
ocl: add vgw router on jump server for functest and yardstick
JIRA: COMPASS-391 Change-Id: I99120617282a27ed8b2d811ad00ae4d10adff93b Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/roles/open-contrail/tasks/ext-net.yml28
-rwxr-xr-xdeploy/launch.sh5
2 files changed, 33 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/ext-net.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/ext-net.yml
index 8f3e095d..3ef327ee 100644
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/ext-net.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/ext-net.yml
@@ -17,3 +17,31 @@
- name: add vgw router on compute(without vgw) for open-contrail
shell: echo "ip route add {{ public_net_info.floating_ip_cidr }} via {{ ip_settings[groups['compute'][0]]['br-prv']['ip'] }} dev vhost0" >> /etc/init.d/net_init
when: groups['opencontrail']|length !=0 and inventory_hostname not in groups['opencontrail'] and inventory_hostname != groups['compute'][0]
+
+
+
+
+
+# create a file with vgw ip on CompassCore, so that Jumper Host could access this to get vgw ip
+- name: add vgw file on compass
+ local_action: file path=/home/opencontrail1.rc state=touch mode=0777
+ run_once: True
+ when: groups['opencontrail']|length !=0
+
+- name: update vgw file
+ local_action: lineinfile dest=/home/opencontrail1.rc line={{ ip_settings[groups['compute'][0]]['br-prv']['ip'] }}
+ run_once: True
+ when: groups['opencontrail']|length !=0
+
+- name: add vgw file on compass
+ local_action: file path=/home/opencontrail2.rc state=touch mode=0777
+ run_once: True
+ when: groups['opencontrail']|length !=0
+
+- name: update vgw file
+ local_action: lineinfile dest=/home/opencontrail2.rc line={{ public_net_info.floating_ip_cidr }}
+ run_once: True
+ when: groups['opencontrail']|length !=0
+
+
+
diff --git a/deploy/launch.sh b/deploy/launch.sh
index f9d915bf..fbffc98c 100755
--- a/deploy/launch.sh
+++ b/deploy/launch.sh
@@ -82,6 +82,11 @@ if [[ "$DEPLOY_HOST" == "true" || $REDEPLOY_HOST == "true" ]]; then
echo $TYPE
echo $DHA
if [[ `echo $HOST_ROLES | grep opencontrail` ]]; then
+ ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
+ installer_ip="192.168.200.2"
+ vgw_ip=$(sshpass -p 'root' ssh $ssh_options root@$installer_ip 'cat /home/opencontrail1.rc')
+ externet_cidr=$(sshpass -p 'root' ssh $ssh_options root@$installer_ip 'cat /home/opencontrail2.rc')
+ sudo ip route add $externet_cidr via $vgw_ip dev br-external 2>/dev/null
sleep 60
python ${COMPASS_DIR}/deploy/reset_compute.py $TYPE $DHA
sleep 600