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 set -o pipefail
case "${DISTRO_NAME}" in case "${DISTRO_NAME}" in
rhel | centos | centos7 ) rhel | rhel7 | centos | centos7 )
chkconfig ambari-server off chkconfig ambari-server off
chkconfig ambari-agent off chkconfig ambari-agent off
;; ;;

View File

@ -12,7 +12,7 @@ case "${DISTRO_NAME}" in
rhel | centos ) 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 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 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 ) ubuntu )

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@ following syntax to select the ``MapR`` plugin:
.. sourcecode:: bash .. 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 In order to speed up image creation process you can download archives with MapR
repositories and specify environment variables: repositories and specify environment variables:

View File

@ -64,7 +64,7 @@ EOF
watchdog \ watchdog \
zlib1g-dev \ zlib1g-dev \
zip 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 \ install-packages cdparanoia-libs \
cups \ cups \
cups-libs \ cups-libs \

View File

@ -32,7 +32,7 @@ if [ "$DISTRO_NAME" = "ubuntu" ]; then
wget -N ${URL}/${PKG}.deb wget -N ${URL}/${PKG}.deb
dpkg -i ${PKG}.deb dpkg -i ${PKG}.deb
rm ${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 rpm -Uhv ${URL}/${PKG}.rpm
fi fi

View File

@ -15,7 +15,7 @@ get_repo_url() {
if [ "$DISTRO_NAME" = "ubuntu" ]; then 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}" 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}" 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 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/}" repo_url="${DIB_MAPR_ECO_DEB_REPO:-http://package.mapr.com/releases/ecosystem-5.x/ubuntu binary/}"
;; ;;
esac 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 case "$DIB_MAPR_VERSION" in
"5.0.0"|"5.1.0"|"5.2.0") "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}" 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 -eu
set -o pipefail 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 sed '/^Defaults requiretty*/ s/^/#/' -i /etc/sudoers
fi fi

View File

@ -8,6 +8,6 @@ set -o pipefail
if [ "$DISTRO_NAME" = "ubuntu" ]; then if [ "$DISTRO_NAME" = "ubuntu" ]; then
apt-get update 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 yum clean all && yum repolist
fi fi

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ case "$DISTRO_NAME" in
update-alternatives --set java $JRE_HOME/bin/java update-alternatives --set java $JRE_HOME/bin/java
update-alternatives --set javac $JDK_HOME/bin/javac 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/java java $JRE_HOME/bin/java 200000
alternatives --install /usr/bin/javac javac $JDK_HOME/bin/javac 200000 alternatives --install /usr/bin/javac javac $JDK_HOME/bin/javac 200000
;; ;;

View File

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

View File

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

View File

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