summaryrefslogtreecommitdiffstats
path: root/ci/nosdn/juju-deployer/scripts/openstack.sh
blob: 77f9772359fbc7249341a7982e1c821b93c533eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh -ex

configOpenrc()
{
	cat <<-EOF
		export OS_USERNAME=$1
		export OS_PASSWORD=$2
		export OS_TENANT_NAME=$3
		export OS_AUTH_URL=$4
		export OS_REGION_NAME=$5
		EOF
}

unitAddress()
{
	juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"public-address\"]" 2> /dev/null
}

unitMachine()
{
	juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"machine\"]" 2> /dev/null
}

<<<<<<< HEAD
juju run --service ceph 'sudo ceph osd pool set cinder-ceph size 1'
juju run --service ceph 'sudo ceph osd pool set cinder-ceph min_size 1'
=======
#juju run --service ceph 'sudo ceph osd pool set cinder-ceph size 1'
#juju run --service ceph 'sudo ceph osd pool set cinder-ceph min_size 1'
>>>>>>> 69227d1... modified the bundle to include the ceph and cinder changes.

mkdir -m 0700 -p cloud
controller_address=$(unitAddress keystone 0)
configOpenrc admin openstack admin http://$controller_address:5000/v2.0 Canonical > cloud/admin-openrc
chmod 0600 cloud/admin-openrc

machine=$(unitMachine glance 0)
juju scp glance.sh cloud/admin-openrc $machine:
juju run --machine $machine ./glance.sh

machine=$(unitMachine nova-cloud-controller 0)
juju scp cloud-setup.sh cloud/admin-openrc ~/.ssh/id_rsa.pub $machine:
juju run --machine $machine ./cloud-setup.sh