Use upstream Puppet modules
This change gets rid of the Fuel Puppet modules in favor of the upstream modules. Change-Id: I797bd4adb647eaca25a7cb171293d47cebcf2945
This commit is contained in:
parent
4e50037e96
commit
75cb0a8e71
46
functions.sh
Normal file
46
functions.sh
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copyright 2015 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")")"
|
||||||
|
MODULES_DIR="${ROOT}"/deployment_scripts/puppet/modules
|
||||||
|
RPM_REPO="${ROOT}"/repositories/centos/
|
||||||
|
DEB_REPO="${ROOT}"/repositories/ubuntu/
|
||||||
|
|
||||||
|
# Download RPM or DEB packages and store them in the local repository directory
|
||||||
|
function download_package {
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
if [[ "$1" == *.deb ]]; then
|
||||||
|
REPO=$DEB_REPO
|
||||||
|
elif [[ "$1" == *.rpm ]]; then
|
||||||
|
REPO=$RPM_REPO
|
||||||
|
else
|
||||||
|
echo "Invalid URL for download_package(): $1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILE=$(basename "$1")
|
||||||
|
wget -qO - "$1" > "$REPO"/"$FILE"
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Download official Puppet module and store it in the local directory
|
||||||
|
function download_puppet_module {
|
||||||
|
rm -rf "${MODULES_DIR:?}"/"$1"
|
||||||
|
mkdir -p "${MODULES_DIR}"/"$1"
|
||||||
|
wget -qO- "$2" | tar -C "${MODULES_DIR}/$1" --strip-components=1 -xz
|
||||||
|
}
|
||||||
|
|
@ -1,40 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
ROOT="$(dirname "$(readlink -f "$0")")"
|
. "$(dirname "$(readlink -f "$0")")"/functions.sh
|
||||||
MODULES="${ROOT}"/deployment_scripts/puppet/modules
|
|
||||||
RPM_REPO="${ROOT}"/repositories/centos/
|
|
||||||
DEB_REPO="${ROOT}"/repositories/ubuntu/
|
|
||||||
|
|
||||||
# Puppet manifests
|
# Puppet manifests
|
||||||
ELASTICSEARCH_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/elasticsearch-elasticsearch-0.9.1.tar.gz"
|
CONCAT_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/puppetlabs-concat-1.2.4.tar.gz"
|
||||||
|
STDLIB_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.7.0.tar.gz"
|
||||||
|
LVM_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/puppetlabs-lvm-0.5.0.tar.gz"
|
||||||
NGINX_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/jfryman-nginx-0.2.2.tar.gz"
|
NGINX_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/jfryman-nginx-0.2.2.tar.gz"
|
||||||
|
ELASTICSEARCH_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/elasticsearch-elasticsearch-0.9.1.tar.gz"
|
||||||
# Puppet manifests from fuel-lib
|
|
||||||
# This is the commit id for the current stable/6.1 branch
|
|
||||||
FUEL_LIB_COMMIT="be44e9ea792fe4314ac8c1b7596742ceb5163f61"
|
|
||||||
FUEL_LIB_TARBALL_URL="https://github.com/stackforge/fuel-library/archive/${FUEL_LIB_COMMIT}.tar.gz"
|
|
||||||
|
|
||||||
# Kibana 3 sources
|
# Kibana 3 sources
|
||||||
KIBANA_TARBALL_URL="https://download.elasticsearch.org/kibana/kibana/kibana-3.1.2.tar.gz"
|
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
|
# 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 \
|
download_package 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/j/java-common/java-common_0.51_all.deb \
|
||||||
http://mirrors.kernel.org/ubuntu/pool/main/t/tzdata/tzdata-java_2015d-0ubuntu0.14.04_all.deb \
|
http://mirrors.kernel.org/ubuntu/pool/main/t/tzdata/tzdata-java_2015d-0ubuntu0.14.04_all.deb \
|
||||||
http://mirrors.kernel.org/ubuntu/pool/main/t/tzdata/tzdata_2015d-0ubuntu0.14.04_all.deb \
|
http://mirrors.kernel.org/ubuntu/pool/main/t/tzdata/tzdata_2015d-0ubuntu0.14.04_all.deb \
|
||||||
@ -45,26 +25,19 @@ download deb http://mirrors.kernel.org/ubuntu/pool/main/p/pcsc-lite/libpcsclite1
|
|||||||
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.5.deb
|
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.5.deb
|
||||||
|
|
||||||
# For redhat only java 1.8 headless is needed
|
# For redhat only java 1.8 headless is needed
|
||||||
download rpm http://mirror.centos.org/centos/6/updates/x86_64/Packages/java-1.8.0-openjdk-headless-1.8.0.51-1.b16.el6_7.x86_64.rpm \
|
download_package http://mirror.centos.org/centos/6/updates/x86_64/Packages/java-1.8.0-openjdk-headless-1.8.0.51-1.b16.el6_7.x86_64.rpm \
|
||||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/jpackage-utils-1.7.5-3.14.el6.noarch.rpm \
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/jpackage-utils-1.7.5-3.14.el6.noarch.rpm \
|
||||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/tzdata-java-2015e-1.el6.noarch.rpm \
|
http://mirror.centos.org/centos/6/os/x86_64/Packages/tzdata-java-2015e-1.el6.noarch.rpm \
|
||||||
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.5.noarch.rpm
|
https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.5.noarch.rpm
|
||||||
|
|
||||||
# Install puppet manifests
|
# Install puppet manifests
|
||||||
# Clean-up first
|
download_puppet_module "concat" "$CONCAT_TARBALL_URL"
|
||||||
rm -rf "${MODULES:?}"/{stdlib,concat,lvm,elasticsearch,nginx}
|
download_puppet_module "stdlib" "$STDLIB_TARBALL_URL"
|
||||||
mkdir -p "${MODULES}"/{elasticsearch,nginx}
|
download_puppet_module "lvm" "$LVM_TARBALL_URL"
|
||||||
|
download_puppet_module "nginx" "$NGINX_TARBALL_URL"
|
||||||
# Include elasticsearch and nginx manifests from puppetlabs
|
download_puppet_module "elasticsearch" "$ELASTICSEARCH_TARBALL_URL"
|
||||||
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_COMMIT}/deployment/puppet/{stdlib,concat,lvm}
|
|
||||||
|
|
||||||
# Untar kibana
|
# Untar kibana
|
||||||
KIBANA_FOLDER="${MODULES}/lma_logging_analytics/files/kibana/src"
|
KIBANA_FOLDER="${MODULES_DIR}/lma_logging_analytics/files/kibana/src"
|
||||||
mkdir -p "${KIBANA_FOLDER}"
|
mkdir -p "${KIBANA_FOLDER}"
|
||||||
wget -qO- "${KIBANA_TARBALL_URL}" | tar -C "${KIBANA_FOLDER}" --strip-components=1 -xz
|
wget -qO- "${KIBANA_TARBALL_URL}" | tar -C "${KIBANA_FOLDER}" --strip-components=1 -xz
|
||||||
|
Loading…
Reference in New Issue
Block a user