Support passing custom PPAs via config, fix a typo in install hook

This commit is contained in:
Adam Gandelman 2011-12-15 17:26:01 -08:00
parent b8287b8180
commit 9d2bacff90
4 changed files with 18 additions and 6 deletions

View File

@ -2,7 +2,7 @@ options:
glance-release:
default: distro
type: string
description: Glance PPA from which to install. (distro, trunk, milestone, milestone-proposed)
description: Glance PPA from which to install. (distro, trunk, milestone, milestone-proposed or ppa:somewhere/else)
api-config:
default: /etc/glance/glance-api.conf
type: string

View File

@ -96,8 +96,20 @@ function add_ppa {
# Install from archive instead of PPA.
[[ $PPA == "distro" ]] && return 0
. /etc/lsb-release
juju-log "glance: Setting up PPA for $PPA"
[[ -z $PPA ]] && return 0
PPA_URL="deb http://ppa.launchpad.net/nova-core/$PPA/ubuntu $DISTRIB_CODENAME main"
add-apt-repository "$PPA_URL" || exit 1
# if referenced by name, setup ppa to upstream PPAs
if [[ "$PPA" == "trunk" ]] ||
[[ "$PPA" == "milestone" ]] ||
[[ "$PPA" == "milestone-proposed" ]] ; then
juju-log "glance: Configuring installation from upstream PPA ($PPA)"
PPA_URL="deb http://ppa.launchpad.net/glance-core/$PPA/ubuntu $DISTRIB_CODENAME main"
add-apt-repository "$PPA_URL" || exit 1
return
fi
if [[ "${PPA:0:4}" == "ppa:" ]] ; then
juju-log "glance: Configuring installation from custom PPA ($PPA)"
add-apt-repository -y "$PPA" || exit 1
return
fi
juju-log "glance: No PPA specified. Falling back to installation from Ubuntu archive."
}

View File

@ -10,7 +10,7 @@ else
fi
function install_hook {
juju-log "Installing nova packages"
juju-log "Installing glance packages"
apt-get -y install python-software-properties || exit 1
add_ppa

View File

@ -1 +1 @@
45
47