modified to add the opensack api on seperate network.
[joid.git] / juju / configure-juju-on-openstack
index 89a6d01..1d98fd0 100755 (executable)
@@ -91,12 +91,11 @@ cd -
 swift stat simplestreams
 
 swift post simplestreams --read-acl .r:*
-openstack service create --name product-stream --description "Product Simple Stream" product-streams
-SWIFT_URL=`openstack endpoint show object-store -c internalurl -f value`
-
-openstack endpoint create --region $OS_REGION_NAME --publicurl $SWIFT_URL/simplestreams/images \
-   --internalurl $SWIFT_URL/simplestreams/images product-streams
+openstack service show product-streams > /dev/null 2>&1 || openstack service create --name product-streams --description "Product Simple Stream" product-streams
 
+SWIFT_URL=`openstack endpoint list --service swift --interface internal -c URL -f value`
+openstack endpoint create --region $OS_REGION_NAME product-streams public $SWIFT_URL/simplestreams/images
+openstack endpoint create --region $OS_REGION_NAME product-streams internal $SWIFT_URL/simplestreams/images
 
 #Output a juju cloud file that works on this cloud
 echo "clouds:
@@ -117,13 +116,15 @@ echo "credentials:
       password: $OS_PASSWORD
       tenant-name: $OS_TENANT_NAME
       username: $OS_USERNAME
+      user-domain-name: $OS_USER_DOMAIN_NAME
+      project-domain-name: $OS_PROJECT_DOMAIN_NAME
 " > os-creds.yaml
 
 juju add-credential openstack -f os-creds.yaml --replace
 
 #Bootstrap with Juju
 
-juju bootstrap openstack --config image-metadata-url=$SWIFT_URL/simplestreams/images --config use-floating-ip=true --config network=private
+juju bootstrap openstack --debug --config image-metadata-url=$SWIFT_URL/simplestreams/images --config use-floating-ip=true --config network=private
 juju gui --show-credentials --no-browser
 
 #Print the address of Juju-gui for deployments on Openstack