diff options
author | Harry Huang <huangxiangyu5@huawei.com> | 2017-02-25 15:56:38 +0800 |
---|---|---|
committer | Harry Huang <huangxiangyu5@huawei.com> | 2017-02-25 15:56:57 +0800 |
commit | da008451297c461788d098f58da9419ed6fcb52c (patch) | |
tree | 214caf86a7bbccd7faf3c6d5f3f5f1255bc4d3b1 /command.sh | |
parent | 420fbebbec6185e662818711bee7b23aec458100 (diff) |
Adjust juju bootstrap
1. use openstack default security group
2. change security group rules to allow all ports
access of both tcp and udp
3. bootstrap juju controller using floating ip and
default security group
Change-Id: I81c943105187fd8ffbde3f3d4e6d96ae24c07e53
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'command.sh')
-rwxr-xr-x | command.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/command.sh b/command.sh new file mode 100755 index 0000000..2f6b76c --- /dev/null +++ b/command.sh @@ -0,0 +1,65 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2016-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 exec_cmd_on_openo() +{ + local rsa_file=${OPENO_VM_DIR}/boot.rsa + local ssh_args="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $rsa_file" + + if [ ! -f $rsa_file ]; then + log_error "open-o vm boot.rsa not found" + exit 1 + fi + + if [ ! $OPENO_VM_IP ]; then + log_error "open-o vm ip not found" + exit 1 + fi + ssh $ssh_args root@$OPENO_VM_IP "$@" +} + +function scp_to_openo() +{ + local rsa_file=${OPENO_VM_DIR}/boot.rsa + local ssh_args="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $rsa_file" + + if [ ! -f $rsa_file ]; then + log_error "open-o vm boot.rsa not found" + exit 1 + fi + + if [ ! $OPENO_VM_IP ]; then + log_error "open-o vm ip not found" + exit 1 + fi + scp $ssh_args $1 root@$OPENO_VM_IP:$2 +} + +function exec_cmd_on_client() +{ + local ssh_args="-o StrictHostKeyChecking=no" + + if [ ! $floating_ip_client ]; then + log_error "juju-client ip not found" + exit 1 + fi + ssh $ssh_options ubuntu@$floating_ip_client "$@" +} + +function exec_cmd_on_metadata() +{ + local ssh_args="-o StrictHostKeyChecking=no" + + if [ ! $floating_ip_metadata ]; then + log_error "juju-metadata ip not found" + exit 1 + fi + ssh $ssh_options ubuntu@$floating_ip_metadata "$@" +} |