Adding rhel7 to elements checks

Up to now we only check for fedora, centos, centos7 and rhel. Rhel7 is
being added to allow the use of rhel7 images

Change-Id: Id0dfa9aab51ec7bb2fe4838c2aa0650f3f026128
This commit is contained in:
Telles Nobrega 2016-09-20 16:54:28 -03:00
parent 42c4a37ab7
commit 3446f21130
22 changed files with 30 additions and 30 deletions

View File

@ -7,7 +7,7 @@ set -eu
set -o pipefail
case "${DISTRO_NAME}" in
rhel | centos | centos7 )
rhel | rhel7 | centos | centos7 )
chkconfig ambari-server off
chkconfig ambari-agent off
;;

View File

@ -12,7 +12,7 @@ case "${DISTRO_NAME}" in
rhel | centos )
wget http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/$DIB_AMBARI_VERSION/ambari.repo -O /etc/yum.repos.d/ambari.repo
;;
centos7 )
rhel7 | centos7 )
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/$DIB_AMBARI_VERSION/ambari.repo -O /etc/yum.repos.d/ambari.repo
;;
ubuntu )

View File

@ -7,7 +7,7 @@ set -eu
set -o pipefail
case "${DISTRO_NAME}" in
fedora | centos | rhel )
fedora | centos | rhel | rhel7 )
if which systemctl; then
systemctl disable firewalld
fi

View File

@ -7,13 +7,13 @@ set -eu
set -o pipefail
case "$DISTRO_NAME" in
fedora | centos7 )
fedora | centos7 | rhel7 )
install-packages iptables-services
;;
esac
case "${DISTRO_NAME}" in
fedora | centos | rhel )
fedora | centos | rhel | rhel7)
if which service; then
service ip6tables save
chkconfig ip6tables off

View File

@ -7,13 +7,13 @@ set -eu
set -o pipefail
case "$DISTRO_NAME" in
fedora | centos7 )
fedora | centos7 | rhel7)
install-packages iptables-services
;;
esac
case "${DISTRO_NAME}" in
fedora | centos | rhel )
fedora | centos | rhel | rhel7)
if which service; then
service iptables save
chkconfig iptables off

View File

@ -14,7 +14,7 @@ if [ -z "${DIB_CDH_HDFS_ONLY:-}" ]; then
JDK_HOME=""
case $DISTRO_NAME in
centos | centos7 | rhel )
centos | centos7 | rhel | rhel7 )
JDK_HOME=$(find /usr/java -name 'jdk*cloudera' -print)
;;
ubuntu )

View File

@ -13,7 +13,7 @@ following syntax to select the ``MapR`` plugin:
.. sourcecode:: bash
diskimage-create.sh -p mapr [-i ubuntu|centos|centos7] [-r 5.0.0 | 5.1.0 | 5.2.0]
diskimage-create.sh -p mapr [-i ubuntu|centos|centos7|rhel|rhel7] [-r 5.0.0 | 5.1.0 | 5.2.0]
In order to speed up image creation process you can download archives with MapR
repositories and specify environment variables:

View File

@ -64,7 +64,7 @@ EOF
watchdog \
zlib1g-dev \
zip
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" -o "$DISTRO_NAME" = "rhel7" ]; then
install-packages cdparanoia-libs \
cups \
cups-libs \

View File

@ -32,7 +32,7 @@ if [ "$DISTRO_NAME" = "ubuntu" ]; then
wget -N ${URL}/${PKG}.deb
dpkg -i ${PKG}.deb
rm ${PKG}.deb
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" -o "$DISTRO_NAME" = "rhel7" ]; then
rpm -Uhv ${URL}/${PKG}.rpm
fi

View File

@ -15,7 +15,7 @@ get_repo_url() {
if [ "$DISTRO_NAME" = "ubuntu" ]; then
repo_url="${DIB_MAPR_CORE_DEB_REPO:-http://package.mapr.com/releases/v${DIB_MAPR_VERSION}/ubuntu/mapr-v${DIB_MAPR_VERSION}GA.deb.tgz}"
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" -o "$DISTRO_NAME" = "rhel7" ]; then
repo_url="${DIB_MAPR_CORE_RPM_REPO:-http://package.mapr.com/releases/v${DIB_MAPR_VERSION}/redhat/mapr-v${DIB_MAPR_VERSION}GA.rpm.tgz}"
fi

View File

@ -21,7 +21,7 @@ get_repo_url() {
repo_url="${DIB_MAPR_ECO_DEB_REPO:-http://package.mapr.com/releases/ecosystem-5.x/ubuntu binary/}"
;;
esac
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" -o "$DISTRO_NAME" = "rhel7" ]; then
case "$DIB_MAPR_VERSION" in
"5.0.0"|"5.1.0"|"5.2.0")
repo_url="${DIB_MAPR_ECO_RPM_REPO:-http://package.mapr.com/releases/ecosystem-5.x/redhat}"

View File

@ -6,7 +6,7 @@ fi
set -eu
set -o pipefail
if [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then
if [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" -o "$DISTRO_NAME" = "rhel7" ]; then
sed '/^Defaults requiretty*/ s/^/#/' -i /etc/sudoers
fi

View File

@ -8,6 +8,6 @@ set -o pipefail
if [ "$DISTRO_NAME" = "ubuntu" ]; then
apt-get update
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" -o "$DISTRO_NAME" = "rhel7" ]; then
yum clean all && yum repolist
fi

View File

@ -40,7 +40,7 @@ download_package() {
if [[ "$distro" == "ubuntu" ]]; then
download_apt_package "$package" "$version" "$directory"
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; then
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" || "$distro" == "rhel7" ]]; then
download_yum_package "$package" "$version" "$directory"
fi
}
@ -93,7 +93,7 @@ create_repo() {
if [[ "$distro" == "ubuntu" ]]; then
create_apt_repo "$directory"
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; then
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" || "$distro" == "rhel7" ]]; then
create_yum_repo "$directory"
fi
}
@ -133,7 +133,7 @@ add_repo() {
if [[ "$distro" == "ubuntu" ]]; then
add_apt_repo "$repo_name" "$repo_url"
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; then
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" || "$distro" == "rhel7" ]]; then
add_yum_repo "$repo_name" "$repo_url"
fi
}
@ -164,7 +164,7 @@ add_local_repo() {
if [[ "$distro" == "ubuntu" ]]; then
add_local_apt_repo "$repo_name" "$directory"
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; then
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" || "$distro" == "rhel7" ]]; then
add_local_yum_repo "$repo_name" "$directory"
fi
}
@ -192,7 +192,7 @@ remove_repo() {
if [[ "$distro" == "ubuntu" ]]; then
remove_apt_repo "$repo_name"
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; then
elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" || "$distro" == "rhel7" ]]; then
remove_yum_repo "$repo_name"
fi
}

View File

@ -66,7 +66,7 @@ EOF
}
case "$DISTRO_NAME" in
fedora | ubuntu | rhel | centos | centos7 )
fedora | ubuntu | rhel | rhel7 | centos | centos7 )
;;
*)
echo "Unknown distro: $DISTRO_NAME. Exiting."
@ -84,7 +84,7 @@ case "$DISTRO_NAME" in
adduser --ingroup hadoop --disabled-password --gecos GECOS hadoop
adduser hadoop sudo
;;
fedora | rhel | centos | centos7 )
fedora | rhel | rhel7 | centos | centos7 )
adduser -G adm,wheel hadoop
;;
esac

View File

@ -19,7 +19,7 @@ function download_hadoop_v2 {
}
case "$DISTRO_NAME" in
fedora | ubuntu | rhel | centos | centos7 )
fedora | ubuntu | rhel | rhel7 | centos | centos7 )
;;
*)
echo "Unknown distro: $DISTRO_NAME. Exiting."

View File

@ -7,7 +7,7 @@ set -eu
set -o pipefail
case "${DISTRO_NAME}" in
centos | centos7 | rhel | fedora )
centos | centos7 | rhel | rhel7 | fedora )
export DIB_DEFAULT_APACHE_DIR="/var/www/html"
;;
ubuntu )

View File

@ -7,7 +7,7 @@ set -eu
set -o pipefail
case "${DISTRO_NAME}" in
centos | rhel )
centos | centos7 | rhel | rhel7 )
chkconfig httpd on
;;
esac

View File

@ -36,7 +36,7 @@ case "$DISTRO_NAME" in
update-alternatives --set java $JRE_HOME/bin/java
update-alternatives --set javac $JDK_HOME/bin/javac
;;
fedora | rhel | centos | centos7 )
fedora | rhel | rhel7 | centos | centos7 )
alternatives --install /usr/bin/java java $JRE_HOME/bin/java 200000
alternatives --install /usr/bin/javac javac $JDK_HOME/bin/javac 200000
;;

View File

@ -7,7 +7,7 @@ set -eu
set -o pipefail
case "$DISTRO_NAME" in
fedora | rhel | centos | centos7 )
fedora | rhel | rhel7 | centos | centos7 )
mkdir -p /etc/mysql/conf.d
;;
esac

View File

@ -20,7 +20,7 @@ default_jdk_version_for_distro () {
echo "7"
fi
;;
centos7 )
centos7 | rhel7 )
echo "8"
;;
*)
@ -41,7 +41,7 @@ case "$DISTRO_NAME" in
JDK_PATH=$(update-alternatives --list javac)
JDK_HOME=${JDK_PATH%/bin/javac}
;;
fedora | rhel | centos | centos7 )
fedora | rhel | rhel7 | centos | centos7 )
# NOTE: rpm -E "%{java_home}" command returns wrong java home
# on CentOS, Fedora and RHEL
JRE_HOME="/usr/lib/jvm/java-openjdk/jre"

View File

@ -35,7 +35,7 @@ set /files/etc/ssh/sshd_config/PubkeyAuthentication yes
save
EOF
;;
rhel | centos | centos7 )
rhel | rhel7 | centos | centos7 )
sed -i 's/ssh_pwauth: 0/ssh_pwauth: 1/' /etc/cloud/cloud.cfg
augtool <<EOF
clear /files/etc/sudoers/Defaults[type=':nrpe']/requiretty/negate