aboutsummaryrefslogtreecommitdiffstats
path: root/juju
diff options
context:
space:
mode:
Diffstat (limited to 'juju')
-rwxr-xr-xjuju/adapter.sh2
-rwxr-xr-xjuju/juju_launch.sh18
-rwxr-xr-xjuju/juju_setup.sh4
3 files changed, 18 insertions, 6 deletions
diff --git a/juju/adapter.sh b/juju/adapter.sh
index f4c2d52..2f1d8f7 100755
--- a/juju/adapter.sh
+++ b/juju/adapter.sh
@@ -19,7 +19,7 @@ function generate_compass_openrc()
PUBLIC_VIP=$(eval "$exec_command $cmd")
echo -e "export OS_PASSWORD=console \n\
-export OS_TENANT_NAME=admin \n\
+export OS_PROJECT_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\
diff --git a/juju/juju_launch.sh b/juju/juju_launch.sh
index 10a35bb..a4cf604 100755
--- a/juju/juju_launch.sh
+++ b/juju/juju_launch.sh
@@ -24,11 +24,19 @@ function launch_juju_vm()
--key-name jump-key --security-group juju-default juju-metadata-vm
fi
+ count=300
set +x
- until [[ $(nova list | grep juju-metadata-vm | grep ACTIVE) ]]
- do
- sleep 1
- done
+ while
+ state1=$(nova list | grep juju-client-vm | awk '{print $6}')
+ state2=$(nova list | grep juju-metadata-vm | awk '{print $6}')
+ if [[ $state1 == "ERROR" || $state2 == "ERROR" || $count == 0 ]]; then
+ log_error "launch juju vm error"
+ exit 1
+ fi
+ let count-=1
+ sleep 2
+ [[ $state1 != "ACTIVE" || $state2 != "ACTIVE" ]]
+ do :;done
set -x
if [ ! $(nova list | grep juju-client-vm | awk '{print $14}') ]; then
@@ -108,7 +116,7 @@ function juju_client_prepare()
openstack:
auth-type: userpass
password: $OS_PASSWORD
- tenant-name: $OS_TENANT_NAME
+ tenant-name: $OS_PROJECT_NAME
username: $OS_USERNAME' > os-creds.yaml"
# credential uses keystone url V3
diff --git a/juju/juju_setup.sh b/juju/juju_setup.sh
index 61e0152..dc8e99b 100755
--- a/juju/juju_setup.sh
+++ b/juju/juju_setup.sh
@@ -79,6 +79,10 @@ function juju_prepare()
--remote-ip-prefix 0.0.0.0/0 juju-default
fi
+ if [ ! -f ~/.ssh/id_rsa.pub ]; then
+ ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""
+ fi
+
openstack keypair list | grep jump-key || openstack keypair create --public-key ~/.ssh/id_rsa.pub jump-key
openstack flavor show m1.tiny || openstack flavor create --ram 512 --disk 5 --vcpus 1 --public m1.tiny