69 lines
3.1 KiB
Bash
Executable File
69 lines
3.1 KiB
Bash
Executable File
#!/bin/bash
|
|
set -eux
|
|
|
|
ROOT="$(dirname "$(readlink -f "$0")")"
|
|
MODULES="${ROOT}"/deployment_scripts/puppet/modules
|
|
RPM_REPO="${ROOT}"/repositories/centos/
|
|
DEB_REPO="${ROOT}"/repositories/ubuntu/
|
|
|
|
# Puppet manifests
|
|
ELASTICSEARCH_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/elasticsearch-elasticsearch-0.9.1.tar.gz"
|
|
NGINX_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/jfryman-nginx-0.2.2.tar.gz"
|
|
|
|
# Puppet manifests from fuel-lib
|
|
FUEL_LIB_VERSION="6.0"
|
|
FUEL_LIB_TARBALL_URL="https://github.com/stackforge/fuel-library/archive/${FUEL_LIB_VERSION}.tar.gz"
|
|
|
|
# Kibana 3 sources
|
|
KIBANA_TARBALL_URL="https://download.elasticsearch.org/kibana/kibana/kibana-3.1.2.tar.gz"
|
|
|
|
# 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
|
|
}
|
|
|
|
# Packages needed to install JRE headless
|
|
download deb http://mirrors.kernel.org/ubuntu/pool/main/p/pcsc-lite/libpcsclite1_1.8.10-1ubuntu1_amd64.deb \
|
|
http://mirrors.kernel.org/ubuntu/pool/main/j/java-common/java-common_0.51_all.deb \
|
|
http://mirrors.kernel.org/ubuntu/pool/main/t/tzdata/tzdata-java_2016d-0ubuntu0.14.04_all.deb \
|
|
http://mirrors.kernel.org/ubuntu/pool/main/t/tzdata/tzdata_2016d-0ubuntu0.14.04_all.deb \
|
|
http://mirrors.kernel.org/ubuntu/pool/main/c/ca-certificates/ca-certificates_20160104ubuntu0.14.04.1_all.deb \
|
|
http://mirrors.kernel.org/ubuntu/pool/main/c/ca-certificates-java/ca-certificates-java_20130815ubuntu1_all.deb \
|
|
http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u101-2.6.6-0ubuntu0.14.04.1_amd64.deb \
|
|
https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.deb
|
|
|
|
# For redhat only java 1.8 headless is needed
|
|
download rpm http://mirror.centos.org/centos/6/os/x86_64/Packages/java-1.8.0-openjdk-headless-1.8.0.91-1.b14.el6.x86_64.rpm \
|
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/jpackage-utils-1.7.5-3.16.el6.noarch.rpm \
|
|
http://mirror.centos.org/centos/6/updates/x86_64/Packages/tzdata-java-2016d-1.el6.noarch.rpm \
|
|
https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.noarch.rpm
|
|
|
|
# Install puppet manifests
|
|
# Clean-up first
|
|
rm -rf "${MODULES:?}"/{stdlib,concat,lvm,elasticsearch,nginx}
|
|
mkdir -p "${MODULES}"/{elasticsearch,nginx}
|
|
|
|
# Include elasticsearch and nginx manifests from puppetlabs
|
|
wget -qO- "${ELASTICSEARCH_TARBALL_URL}" | tar -C "${MODULES}/elasticsearch" --strip-components=1 -xz
|
|
wget -qO- "${NGINX_TARBALL_URL}" | tar -C "${MODULES}/nginx" --strip-components=1 -xz
|
|
|
|
# Include dependent manifests from fuel-library
|
|
wget -qO- "${FUEL_LIB_TARBALL_URL}" | \
|
|
tar -C "${MODULES}" --strip-components=3 -zxvf - \
|
|
fuel-library-${FUEL_LIB_VERSION}/deployment/puppet/{stdlib,concat,lvm}
|
|
|
|
# Untar kibana
|
|
KIBANA_FOLDER="${MODULES}/lma_logging_analytics/files/kibana/src"
|
|
mkdir -p "${KIBANA_FOLDER}"
|
|
wget -qO- "${KIBANA_TARBALL_URL}" | tar -C "${KIBANA_FOLDER}" --strip-components=1 -xz
|