Have install_modules install dependencies.

Have install_modules install module dependencies and handle module
upgrades. To make module upgrades sane, you must now specify the desired
version of a module.

Change-Id: I355308311c8555f1146999561de670294466b424
Reviewed-on: https://review.openstack.org/12732
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-09-10 12:46:47 -07:00 committed by Jenkins
parent 7075bbb146
commit 8eb7023cec

37
install_modules.sh Normal file → Executable file
View File

@ -22,28 +22,37 @@ function clone_git() {
cd $OLDDIR
}
if ! puppet help module >/dev/null 2>&1 ; then
if ! puppet help module >/dev/null 2>&1
then
apt-get install -y -o Dpkg::Options::="--force-confold" puppet facter
fi
MODULES="
openstackci-dashboard
openstackci-vcsrepo
puppetlabs-apache
puppetlabs-apt
puppetlabs-mysql
saz-memcached
"
# Array of modules to be installed key:value is module:version.
declare -A MODULES
MODULES["openstackci-dashboard"]="0.0.4"
MODULES["openstackci-vcsrepo"]="0.0.6"
MODULES["puppetlabs-apache"]="0.4.0"
MODULES["puppetlabs-apt"]="0.0.4"
MODULES["puppetlabs-mysql"]="0.5.0"
MODULES["saz-memcached"]="2.0.2"
MODULE_LIST=`puppet module list`
# Transition away from old things
if [ -d /etc/puppet/modules/vcsrepo/.git ] ; then
if [ -d /etc/puppet/modules/vcsrepo/.git ]
then
rm -rf /etc/puppet/modules/vcsrepo
fi
for MOD in $MODULES ; do
if ! echo $MODULE_LIST | grep $MOD >/dev/null 2>&1 ; then
# This will get run in cron, so silence non-error output
puppet module install --force $MOD >/dev/null
for MOD in ${!MODULES[*]} ; do
# If the module at the current version does not exist upgrade or install it.
if ! echo $MODULE_LIST | grep "$MOD.*${MODULES[$MOD]}" >/dev/null 2>&1
then
# Attempt module upgrade. If that fails try installing the module.
if ! puppet module upgrade $MOD --version ${MODULES[$MOD]} >/dev/null 2>&1
then
# This will get run in cron, so silence non-error output
puppet module install $MOD --version ${MODULES[$MOD]} >/dev/null
fi
fi
done