modified to comment the use of juju-br0 as external network.
[joid.git] / ci / nosdn / juju-deployer / scripts / openstack.sh
1 #!/bin/sh -ex
2
3 configOpenrc()
4 {
5         cat <<-EOF
6                 export OS_USERNAME=$1
7                 export OS_PASSWORD=$2
8                 export OS_TENANT_NAME=$3
9                 export OS_AUTH_URL=$4
10                 export OS_REGION_NAME=$5
11                 EOF
12 }
13
14 unitAddress()
15 {
16         juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"public-address\"]" 2> /dev/null
17 }
18
19 unitMachine()
20 {
21         juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"machine\"]" 2> /dev/null
22 }
23
24 <<<<<<< HEAD
25 juju run --service ceph 'sudo ceph osd pool set cinder-ceph size 1'
26 juju run --service ceph 'sudo ceph osd pool set cinder-ceph min_size 1'
27 =======
28 #juju run --service ceph 'sudo ceph osd pool set cinder-ceph size 1'
29 #juju run --service ceph 'sudo ceph osd pool set cinder-ceph min_size 1'
30 >>>>>>> 69227d1... modified the bundle to include the ceph and cinder changes.
31
32 mkdir -m 0700 -p cloud
33 controller_address=$(unitAddress keystone 0)
34 configOpenrc admin openstack admin http://$controller_address:5000/v2.0 Canonical > cloud/admin-openrc
35 chmod 0600 cloud/admin-openrc
36
37 machine=$(unitMachine glance 0)
38 juju scp glance.sh cloud/admin-openrc $machine:
39 juju run --machine $machine ./glance.sh
40
41 machine=$(unitMachine nova-cloud-controller 0)
42 juju scp cloud-setup.sh cloud/admin-openrc ~/.ssh/id_rsa.pub $machine:
43 juju run --machine $machine ./cloud-setup.sh
44