fuel-plugin-zabbix-snmptrapd/pre_build_hook

49 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2017 Mirantis, Inc.
#
# 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 -eux
ROOT="$(dirname "$(readlink -f "$0")")"
. "${ROOT}"/functions.sh
# Puppet manifests
# Dependency for SNMP
SNMP_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/razorsedge-snmp-3.3.1.tar.gz"
RPM_REPO="${ROOT}"/repositories/centos
DEB_TRUSTY_REPO="${ROOT}"/repositories/ubuntu/trusty
DEB_XENIAL_REPO="${ROOT}"/repositories/ubuntu/xenial
mkdir -p $RPM_REPO $DEB_TRUSTY_REPO $DEB_XENIAL_REPO
SNMP_TRUSTY_VERSION="5.7.2~dfsg-8.1ubuntu3.1"
SNMP_TRUSTY_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/libsnmp-perl_${SNMP_TRUSTY_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmpd_${SNMP_TRUSTY_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmp_${SNMP_TRUSTY_VERSION}_amd64.deb"
COMMON_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/universe/s/snmptt/snmptt_1.4-1_all.deb"
download_package "$DEB_TRUSTY_REPO" $SNMP_TRUSTY_PACKAGES $COMMON_PACKAGES
SNMP_XENIAL_VERSION="5.7.3+dfsg-1ubuntu4"
SNMP_XENIAL_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/libsnmp-perl_${SNMP_XENIAL_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/snmptrapd_${SNMP_XENIAL_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmpd_${SNMP_XENIAL_VERSION}_amd64.deb \
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmp_${SNMP_XENIAL_VERSION}_amd64.deb"
download_package "$DEB_XENIAL_REPO" $SNMP_XENIAL_PACKAGES $COMMON_PACKAGES
# Install puppet manifests
download_puppet_module "snmp" "$SNMP_TARBALL_URL"