Merge "Add ADDITIONAL_REQS config option"

This commit is contained in:
Jenkins 2017-05-04 10:21:02 +00:00 committed by Gerrit Code Review
commit 5e498d23b4
4 changed files with 46 additions and 11 deletions

View File

@ -21,17 +21,8 @@ function stop_collectd {
function install_requirements {
echo "Installing pre-resquisites"
if is_ubuntu; then
install_package libvirt-bin libvirt-dev python-libvirt
if [[ "$COLLECTD_INSTALL_TYPE" == "source" ]]; then
install_package byacc flex bison build-essential automake libgcrypt20 libtool
fi
elif is_fedora; then
install_package libvirt libvirt-devel libvirt-python
if [[ "$COLLECTD_INSTALL_TYPE" == "source" ]]; then
install_package flex bison automake autoconf libtool
fi
if [[ ! -z "$COLLECTD_REQUIREMENTS" ]]; then
install_package $COLLECTD_REQUIREMENTS $COLLECTD_ADDITIONAL_PACKAGES
else
echo "Unsupported distros"
fi

View File

@ -43,3 +43,27 @@ fi
#Custom units feature
COLLECTD_CEILOMETER_UNITS=${COLLECTD_CEILOMETER_CUSTOM_UNITS:-none}
COLLECTD_GNOCCHI_UNITS=${COLLECTD_GNOCCHI_CUSTOM_UNITS:-none}
# User defined requirements
COLLECTD_ADDITIONAL_PACKAGES=${COLLECTD_ADDITIONAL_PACKAGES:-''}
COLLECTD_REQUIREMENTS=''
# Definition for requirements
ubuntu_bin_requirements="libvirt-bin libvirt-dev python-libvirt"
ubuntu_src_requirements="$ubuntu_bin_requirements byacc flex bison build-essential automake libgcrypt20 libtool"
centos_bin_requirements="libvirt libvirt-devel libvirt-python"
centos_src_requirements="$centos_bin_requirements flex bison automake autoconf libtool"
if is_ubuntu; then
if [[ "$COLLECTD_INSTALL_TYPE" == "source" ]]; then
COLLECTD_REQUIREMENTS="$ubuntu_src_requirements"
else
COLLECTD_REQUIREMENTS="$ubuntu_bin_requirements"
fi
elif is_fedora; then
if [[ "$COLLECTD_INSTALL_TYPE" == "source" ]]; then
COLLECTD_REQUIREMENTS="$centos_src_requirements"
else
COLLECTD_REQUIREMENTS="$centos_bin_requirements"
fi
fi

View File

@ -101,6 +101,17 @@ To enable this feature execute the following instructions:
| COLLECTD_CUSTOM_UNITS="<meter> <unit>,<meter> <unit>"
Custom Packages Feature
------------------------
This feature enables users to define new packages to be installed when building
collectd.
* To include your new packages, add the following line with your chosen
packages to your local.conf file.
| COLLECTD_ADDITIONAL_PACKAGES="package1 package2 package3"
Gnocchi
-------

View File

@ -173,6 +173,15 @@ COLLECTD_PREFIX
Default: /usr/
COLLECTD_ADDITIONAL_PACKAGES
Specify additional packages to be installed before collectd is
built/installed. This is useful when building collectd from source it
will make sure the packages are installed. Collectd plugins are
automatically installed/built if requirements are met, so there is no need
for manual installation. A space separates packages.
Example: COLLECTD_ADDITIONAL_PACKAGES="package1 package2 package3"
Authenticating using Identity Server API v3
-------------------------------------------