40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
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_REPO="${ROOT}"/repositories/ubuntu
|
|
MODULES="${ROOT}"/deployment_scripts/puppet/modules
|
|
mkdir -p $RPM_REPO $DEB_REPO
|
|
|
|
# Downloads needed RPM or DEB packages
|
|
function download {
|
|
case "$1" in
|
|
deb) REPO=$DEB_REPO;;
|
|
rpm) REPO=$RPM_REPO;;
|
|
esac
|
|
shift
|
|
|
|
while [ $# -gt 0 ]; do
|
|
FILE=$(basename "$1")
|
|
wget -qO - $1 > "$REPO/$FILE"
|
|
shift
|
|
done
|
|
}
|
|
|
|
download deb http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/libsnmp-perl_5.7.2~dfsg-8.1ubuntu3.1_amd64.deb \
|
|
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmpd_5.7.2~dfsg-8.1ubuntu3.1_amd64.deb \
|
|
http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmp_5.7.2~dfsg-8.1ubuntu3.1_amd64.deb \
|
|
http://archive.ubuntu.com/ubuntu/pool/universe/s/snmptt/snmptt_1.4-1_all.deb
|
|
|
|
|
|
# Install puppet manifests
|
|
download_puppet_module "snmp" "$SNMP_TARBALL_URL"
|