diff options
author | Narinder Gupta <narinder.gupta@canonical.com> | 2015-11-11 13:37:41 -0600 |
---|---|---|
committer | Narinder Gupta <narinder.gupta@canonical.com> | 2015-11-11 13:38:31 -0600 |
commit | b7b23a46f98bf279fd6b31ed5928e3045cfc746e (patch) | |
tree | 557d8e5444cd877969fa43fa16101e718ce72d22 /ci/odl/juju-deployer/scripts/openstack.sh | |
parent | ef0bf9ac1985e1ba1911fa2d6020a1cbf55cfde2 (diff) |
added new scripts to configure openstac after install.
Change-Id: Ia5f87da468505ba89a0b61fa92c020caba37b2a2
Author: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci/odl/juju-deployer/scripts/openstack.sh')
-rwxr-xr-x | ci/odl/juju-deployer/scripts/openstack.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ci/odl/juju-deployer/scripts/openstack.sh b/ci/odl/juju-deployer/scripts/openstack.sh new file mode 100755 index 00000000..e12ebbfd --- /dev/null +++ b/ci/odl/juju-deployer/scripts/openstack.sh @@ -0,0 +1,36 @@ +#!/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 +} + +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 + |