aboutsummaryrefslogtreecommitdiff
path: root/bigtop_toolchain
diff options
context:
space:
mode:
authorOlaf Flebbe <of@oflebbe.de>2015-09-08 21:25:10 +0200
committerEvans Ye <evansye@apache.org>2015-09-10 09:13:12 +0000
commit9a8b0d78b2b6e16d7a045c252243d19f8e1bd3d4 (patch)
tree3166bce25b0156268b8eeb09d8135e6eca63c65f /bigtop_toolchain
parentdb3e38a78d854e11a51ef2f5dfa3049971010d76 (diff)
downloadbigtop-odpi-9a8b0d78b2b6e16d7a045c252243d19f8e1bd3d4.tar.gz
BIGTOP-2018: Create a puppetizing script
Signed-off-by: Evans Ye <evansye@apache.org>
Diffstat (limited to 'bigtop_toolchain')
-rwxr-xr-xbigtop_toolchain/bin/puppetize.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/bigtop_toolchain/bin/puppetize.sh b/bigtop_toolchain/bin/puppetize.sh
new file mode 100755
index 00000000..84681f93
--- /dev/null
+++ b/bigtop_toolchain/bin/puppetize.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# Use /etc/os-release to determine Linux Distro
+
+if [ -f /etc/os-release ]; then
+ . /etc/os-release
+else
+ if [ -f /etc/redhat-release ]; then
+ if grep "CentOS release 6" /etc/redhat-release >/dev/null ; then
+ ID=centos
+ VERSION_ID=6
+ fi
+ else
+ echo "Unknown Linux Distribution."
+ exit 1
+ fi
+fi
+
+case ${ID}-${VERSION_ID} in
+ fedora-20*)
+ # Work around issue in fedora:20 docker image
+ yum -y install yum-utils; yum-config-manager --enable updates-testing
+ rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-fedora-20.noarch.rpm
+ yum update
+ yum -y install hostname curl sudo unzip wget puppet
+ ;;
+ ubuntu-14.04)
+ # BIGTOP-2003. A workaround to install newer hiera to get rid of hiera 1.3.0 bug.
+ apt-get -y install wget
+ wget -O /tmp/puppetlabs-release-trusty.deb https://apt.puppetlabs.com/puppetlabs-release-trusty.deb && dpkg -i /tmp/puppetlabs-release-trusty.deb
+ rm -f /tmp/puppetlabs-release-trusty.deb
+ apt-get update
+ apt-get -y install curl sudo unzip puppet software-properties-common
+ ;;
+ ubuntu-15*)
+ apt-get update
+ apt-get -y install curl sudo unzip wget puppet software-properties-common
+ ;;
+ debian-8*)
+ apt-get update
+ apt-get -y install curl sudo unzip wget puppet
+ ;;
+ opensuse-13.2)
+ zypper --gpg-auto-import-keys install -y curl sudo unzip wget puppet suse-release ca-certificates-mozilla net-tools tar
+ ;;
+ centos-6*)
+ rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
+ yum -y install curl sudo unzip wget puppet tar
+ ;;
+ centos-7*)
+ rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
+ yum -y install hostname curl sudo unzip wget puppet
+ ;;
+ *)
+ echo "Unsupported OS ${ID}-${VERSION_ID}."
+ exit 1
+esac