diff options
Diffstat (limited to 'juju')
-rwxr-xr-x | juju/configure-juju-on-openstack | 14 | ||||
-rwxr-xr-x | juju/get-cloud-images | 2 | ||||
-rwxr-xr-x | juju/joid-configure-openstack | 6 |
3 files changed, 12 insertions, 10 deletions
diff --git a/juju/configure-juju-on-openstack b/juju/configure-juju-on-openstack index f320146e..62ce885e 100755 --- a/juju/configure-juju-on-openstack +++ b/juju/configure-juju-on-openstack @@ -35,24 +35,24 @@ then else FLOAT_IP="$(openstack ip floating create ext-net -c ip -f value)" fi - + #Launch an instance NET_UUID="$(nova net-list | grep private | awk '{ print $2 }')" IMAGE_UUID="$(nova image-list | grep Xenial | awk '{ print $2 }')" nova list | grep jumpserver2 ||nova boot --flavor m1.small --key-name default --image $IMAGE_UUID --nic net-id=$NET_UUID --security-group default jumpserver2 # checking jumpserver2 state until active .. INST_STATE=` nova show jumpserver2 | grep status | awk '{print $4}'` -while [ $INST_STATE != "ACTIVE" ]; -do +while [ $INST_STATE != "ACTIVE" ]; +do INST_STATE=` nova show jumpserver2 | grep status | awk '{print $4}'` echo "Jumpserver2 instance state is: "$INST_STATE" waiting to be active" sleep 1 done sleep 6 #Associate the floating IP with the new instance -nova floating-ip-associate jumpserver2 $FLOAT_IP || true +nova floating-ip-associate jumpserver2 $FLOAT_IP || true -sleep 30 +sleep 90 ### make it more Readable export SSH="ssh -o StrictHostKeyChecking=no ubuntu@$FLOAT_IP" @@ -119,7 +119,7 @@ upload juju-meta tools" $SSH swift --os-auth-url $OS_AUTH_URL --os-username $OS_USERNAME --os-password $OS_PASSWORD \ --os-tenant-name $OS_TENANT_NAME post -r '.r:*' juju-meta -## collect the URL for getting the images +## collect the URL for getting the images $($SSH swift --os-auth-url $OS_AUTH_URL --os-username $OS_USERNAME --os-password $OS_PASSWORD \ --os-tenant-name $OS_TENANT_NAME auth) @@ -139,7 +139,7 @@ $SSH "juju bootstrap openstack openstack --config image-metadata-url=$OS_STORAGE #Create a new floating IP and associate with juju bootstrap instance #INSTANCE_ID="$(nova list | grep juju-openstack-machine-0 | awk '{ print $2}')" #FLOAT_IP2="$(nova floating-ip-create | grep ext_net | awk '{ print $2}')" -#nova floating-ip-associate $INSTANCE_ID $FLOAT_IP2 +#nova floating-ip-associate $INSTANCE_ID $FLOAT_IP2 #Print the address of Juju-gui for deployments on Openstack echo "Now connect to the Juju-GUI at: http://$FLOAT_IP2/ to continue deployments on Openstack." diff --git a/juju/get-cloud-images b/juju/get-cloud-images index f31d067c..bf2ed30b 100755 --- a/juju/get-cloud-images +++ b/juju/get-cloud-images @@ -1,6 +1,8 @@ #!/bin/bash -e folder=/srv/data/ +sudo mkdir $folder || true + URLS="http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img \ http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img \ http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img \ diff --git a/juju/joid-configure-openstack b/juju/joid-configure-openstack index a24fa005..14cc8204 100755 --- a/juju/joid-configure-openstack +++ b/juju/joid-configure-openstack @@ -88,9 +88,9 @@ neutron router-interface-add $ROUTER_ID $SUBNET_ID || true echo "Configuring security groups for access to ICMP, SSH and RDP by default" #Configure the default security group to allow ICMP and SSH -neutron security-group-rule-list default | grep icmp > /dev/null 2>&1 || neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol icmp --remote-ip-prefix 0.0.0.0/0 default -neutron security-group-rule-list default | grep 22 > /dev/null 2>&1 || neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol tcp --port-range-min 22 --port-range-max 22 --remote-ip-prefix 0.0.0.0/0 default -neutron security-group-rule-list default | grep 3389 > /dev/null 2>&1 || neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol tcp --port-range-min 3389 --port-range-max 3389 --remote-ip-prefix 0.0.0.0/0 default +neutron security-group-rule-list | grep icmp > /dev/null 2>&1 || neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol icmp --remote-ip-prefix 0.0.0.0/0 default +neutron security-group-rule-list | grep 22 > /dev/null 2>&1 || neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol tcp --port-range-min 22 --port-range-max 22 --remote-ip-prefix 0.0.0.0/0 default +neutron security-group-rule-list | grep 3389 > /dev/null 2>&1 || neutron security-group-rule-create --direction ingress --ethertype IPv4 --protocol tcp --port-range-min 3389 --port-range-max 3389 --remote-ip-prefix 0.0.0.0/0 default echo "Uploading default SSH key" |