Create install-packages as a binary.

Only supports Debian family distribution so far.

Change-Id: I9fa0b833c34a614fe498c6c6ae599733a69c1309
This commit is contained in:
Ghe Rivero 2013-01-28 06:41:54 +01:00
parent 8997ec6d0b
commit 11b4a5501d
25 changed files with 71 additions and 26 deletions

View File

@ -0,0 +1,38 @@
#!/bin/sh
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -e
# install-packages package [package ...]
install_deb_packages() {
DEBIAN_FRONTEND=noninteractive \
http_proxy=$http_proxy https_proxy=$https_proxy \
no_proxy=$no_proxy \
apt-get --option "Dpkg::Options::=--force-confold" --assume-yes install "$@"
}
DISTRO=`lsb_release -si`
case $DISTRO in
'Ubuntu'|'Debian')
install_deb_packages $@
;;
*)
echo "Distribution not supported"
exit 1
;;
esac

View File

@ -3,4 +3,4 @@
set -e
apt-get -y install linux-image-generic vlan open-iscsi
install-packages linux-image-generic vlan open-iscsi

View File

@ -0,0 +1,3 @@
#!/bin/sh
install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin

View File

@ -4,5 +4,5 @@
set -e
apt-get -y update
apt-get -y install python-software-properties
install-packages python-software-properties
add-apt-repository -y ppa:tripleo/demo

View File

@ -6,7 +6,7 @@
set -e
set -o xtrace
apt-get -y install git
install-packages git
if [ -n "$http_proxy" ]; then
sudo -Hiu stack git config --global http.proxy $http_proxy
fi

View File

@ -4,7 +4,7 @@
set -e
set -o xtrace
apt-get -y install git
install-packages git
if [ -n "$http_proxy" ]; then
sudo -Hiu stack git config --global http.proxy $http_proxy
fi

View File

@ -4,4 +4,4 @@
set -e
set -o xtrace
apt-get -y install haveged
install-packages haveged

View File

@ -5,7 +5,7 @@
set -e
set -o xtrace
DEBIAN_FRONTEND=noninteractive apt-get -y install \
install-packages \
python-pip git-core python-setuptools python-dev python-lxml python-netaddr \
python-pastescript python-pastedeploy python-paste python-sqlalchemy \
python-greenlet python-routes python-simplejson python-webob rabbitmq-server
@ -30,4 +30,3 @@ cp $GLANCE_ROOT/etc/glance-api.conf /etc/glance
cp $GLANCE_ROOT/etc/policy.json /etc/glance
cp $GLANCE_ROOT/etc/glance-api-paste.ini /etc/glance
cp $GLANCE_ROOT/etc/logging.cnf.sample /etc/glance/logging.conf

View File

@ -9,7 +9,7 @@ HEAT_API_SOURCE=https://github.com/heat-api/heat-jeos.git
OS_ROOT=/opt/stack
JEOS_ROOT=$OS_ROOT/heat-jeos
DEBIAN_FRONTEND=noninteractive apt-get -y install git-core python-psutil
install-packages git-core python-psutil
mkdir -p $OS_ROOT
git clone $HEAT_API_SOURCE $JEOS_ROOT

View File

@ -23,4 +23,4 @@ Pin: release o=LP-PPA-tripleo-demo
Pin-Priority: 900
EOF
# Should pull from demo PPA if cloud-init exists there.
apt-get -y install cloud-init
install-packages cloud-init

View File

@ -4,4 +4,4 @@
set -e
set -o xtrace
apt-get -y install hwinfo
install-packages hwinfo

View File

@ -5,4 +5,4 @@
set -e
set -o xtrace
DEBIAN_FRONTEND=noninteractive apt-get -y install icinga-core
install-packages icinga-core

View File

@ -5,5 +5,5 @@
set -e
set -o xtrace
DEBIAN_FRONTEND=noninteractive apt-get -y install icinga-web icinga-cgi
install-packages icinga-web icinga-cgi

View File

@ -3,7 +3,7 @@
set -e
set -o xtrace
apt-get -y install jenkins
install-packages jenkins
# jenkins installs into /var/lib/jenkins which is rather restrictive.
mv /var/lib/jenkins /mnt/

View File

@ -5,7 +5,7 @@
set -e
set -o xtrace
DEBIAN_FRONTEND=noninteractive apt-get -y install \
install-packages \
python-pip git-core python-setuptools python-dev python-lxml python-netaddr \
python-pastescript python-pastedeploy python-paste python-sqlalchemy \
python-greenlet python-routes python-simplejson python-webob

View File

@ -5,5 +5,5 @@
set -e
set -o xtrace
#DEBIAN_FRONTEND=noninteractive apt-get -y install sysstat mytop percona-toolkit percona-server-server-5.5 percona-server-client-5.5
DEBIAN_FRONTEND=noninteractive apt-get -y install sysstat mytop percona-toolkit mysql-server-5.5 mysql-client-5.5
#install-packages sysstat mytop percona-toolkit percona-server-server-5.5 percona-server-client-5.5
install-packages sysstat mytop percona-toolkit mysql-server-5.5 mysql-client-5.5

View File

@ -4,4 +4,4 @@
set -e
set -o xtrace
apt-get -y install haveged
install-packages haveged

View File

@ -3,7 +3,7 @@ set -eux
useradd -G admin -m nova -s /bin/false
DEBIAN_FRONTEND=noninteractive apt-get -y install \
install-packages \
python-pip git-core python-setuptools python-dev python-lxml python-netaddr \
python-pastescript python-pastedeploy python-paste python-sqlalchemy \
python-greenlet python-routes python-simplejson python-webob rabbitmq-server

View File

@ -5,4 +5,4 @@
set -e
set -o xtrace
DEBIAN_FRONTEND=noninteractive apt-get -y install haproxy rabbitmq-server mysql-server ntp dkms
install-packages haproxy rabbitmq-server mysql-server ntp dkms

View File

@ -5,5 +5,5 @@
set -e
set -o xtrace
apt-get -y install keystone glance nova-api nova-cert nova-common nova-scheduler python-nova python-novaclient nova-consoleauth novnc nova-novncproxy cinder-api cinder-scheduler cinder-volume iscsitarget open-iscsi iscsitarget-dkms python-cinderclient nova-network
install-packages keystone glance nova-api nova-cert nova-common nova-scheduler python-nova python-novaclient nova-consoleauth novnc nova-novncproxy cinder-api cinder-scheduler cinder-volume iscsitarget open-iscsi iscsitarget-dkms python-cinderclient nova-network

View File

@ -4,7 +4,7 @@ set -o xtrace
useradd -G admin -m quantum -s /bin/false
DEBIAN_FRONTEND=noninteractive apt-get -y install \
install-packages \
python-pip git-core python-setuptools python-dev python-lxml python-netaddr \
python-pastescript python-pastedeploy python-paste python-sqlalchemy \
python-greenlet python-routes python-simplejson python-webob rabbitmq-server

View File

@ -3,5 +3,5 @@
set -e
set -o xtrace
apt-get -y install salt-master
install-packages salt-master

View File

@ -3,5 +3,5 @@
set -e
set -o xtrace
apt-get -y install salt-minion
install-packages salt-minion

View File

@ -5,5 +5,5 @@
set -e
set -o xtrace
apt-get -y install swift rsync memcached python-netifaces python-xattr python-memcache
install-packages swift rsync memcached python-netifaces python-xattr python-memcache

View File

@ -235,6 +235,11 @@ function do_install () {
function do_extra_package_install () {
# Install any packages that were requested with the -p command line option
if [ "$INSTALL_PACKAGES" != "" ]; then
run_in_target apt-get -y install ${INSTALL_PACKAGES[@]}
run_in_target install-packages ${INSTALL_PACKAGES[@]}
fi
}
function copy_elements_lib () {
sudo mkdir -p $TMP_MOUNT_PATH/lib/diskimage-builder
sudo cp -t $TMP_MOUNT_PATH/lib/diskimage-builder $_LIB/elements-functions
}