Remove CentOS6/RHEL6 support

Deprecated in Pike, and removed from diskimage-builder for a while.

Story: 2001996
Task: 19626
Change-Id: I9b4eab56fcbfcb2e97805fba805eafeeafa5d540
This commit is contained in:
Luigi Toscano 2018-05-15 18:22:50 +02:00
parent aa3ff84f2b
commit 5d05a3db2f
27 changed files with 53 additions and 253 deletions

View File

@ -1,80 +0,0 @@
We have CentOS 6.4 and 6.5 cloud images. Recommended is CentOS 6.5 (http://sahara-files.mirantis.com/CentOS-6.5-cloud-init.qcow2).
Prepare your own CentOS cloud image:
1. Create disk image with qcow2 format
.. sourcecode:: bash
qemu-img create -f qcow2 -o preallocation=metadata /tmp/centos-6-cloud.qcow2 2G
2. Install CentOS, You should use one partition and no swap. Get netinstall ISO from http://isoredirect.centos.org/centos/6/isos/x86_64/.
.. sourcecode:: bash
virt-install --name=centos-6-cloud --disk path=/tmp/centos-6-cloud.qcow2,format=qcow2 -r 1024 --vcpus=1 --hvm -c /tmp/CentOS-6.5-x86_64-netinstall.iso
3. Login into your new image and modify '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
.. sourcecode:: bash
DEVICE="eth0"
BOOTPROTO="dhcp"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
4. Add EPEL repository and update OS
.. sourcecode:: bash
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
5. Install cloud-utils and cloud-init
.. sourcecode:: bash
yum install cloud-utils, cloud-init
6. Download 'centos-image-mod.sh' and 'init-part' together in same directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
.. sourcecode:: bash
git clone https://github.com/jaryn/centos-image-resize
cd centos-image-resize && ./centos-image-mod.sh
6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may not be a bad idea to set timeout to 0.
7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto created during boot. Don't forget this, since you won't have functional network when you bring this image up on Openstack.
8. Check files:
File '/etc/cloud/cloud.cfg' should contain these lines:
.. sourcecode:: cfg
default_user:
name: cloud-user
lock_passwd: true
gecos: CentOS Cloud User
groups: [wheel, adm]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
Add them if they are not exist.
File '/etc/fstab'. Check that fifth and sixth fields contain value '0'.
9. Power down your virtual Centos
10. Compress qcow2 image with
.. sourcecode:: bash
qemu-img convert -c /tmp/centos-6-cloud.qcow2 -O qcow2 /tmp/centos.qcow2
Image /tmp/centos.qcow2 is now ready for upload to Openstack
`Source for this doc <http://lists.openstack.org/pipermail/openstack-operators/2013-June/003131.html>`_

View File

@ -5,7 +5,7 @@ This script builds Ubuntu, Fedora, CentOS cloud images for use in Sahara.
By default the all plugin are targeted, all images will be built. The '-p' By default the all plugin are targeted, all images will be built. The '-p'
option can be used to select plugin (vanilla, spark, cloudera, storm, mapr, option can be used to select plugin (vanilla, spark, cloudera, storm, mapr,
ambari, or plain). The '-i' option can be used to select image type (ubuntu, ambari, or plain). The '-i' option can be used to select image type (ubuntu,
fedora, centos, or centos7). The '-v' option can be used to select hadoop fedora, or centos7). The '-v' option can be used to select hadoop
version. version.
For users: For users:
@ -14,12 +14,12 @@ For users:
Environment variables the script accepts are 'DIB_HADOOP_VERSION_2_7_1', Environment variables the script accepts are 'DIB_HADOOP_VERSION_2_7_1',
'JAVA_DOWNLOAD_URL', 'JAVA_TARGET_LOCATION', 'OOZIE_DOWNLOAD_URL', 'JAVA_DOWNLOAD_URL', 'JAVA_TARGET_LOCATION', 'OOZIE_DOWNLOAD_URL',
'HIVE_VERSION', 'HIVE_VERSION',
'[ubuntu|fedora|centos|centos7]_vanilla_hadoop_2_7_1_image_name', '[ubuntu|fedora|centos7]_vanilla_hadoop_2_7_1_image_name',
'ubuntu_spark_image_name', 'ubuntu_storm_image_name', 'ubuntu_spark_image_name', 'ubuntu_storm_image_name',
'ambari_[ubuntu|centos|centos7]_image_name', 'ambari_[ubuntu|centos7]_image_name',
'cloudera_[5_5|5_7|5_9]_[ubuntu|centos]_image_name', 'cloudera_[5_7|5_9|5_11]_[ubuntu|centos7]_image_name',
'mapr_[ubuntu|centos|centos7]_image_name', 'mapr_[ubuntu|centos7]_image_name',
'plain_[ubuntu|fedora|centos|centos7]_image_name'. 'plain_[ubuntu|fedora|centos7]_image_name'.
2. For creating all images just clone this repository and run script. 2. For creating all images just clone this repository and run script.
@ -73,7 +73,7 @@ like this:
.. sourcecode:: bash .. sourcecode:: bash
tox -e venv -- sahara-image-create -i [ubuntu|fedora|centos|centos7] tox -e venv -- sahara-image-create -i [ubuntu|fedora|centos7]
7. To select which Spark version to target use the '-s' commandline option 7. To select which Spark version to target use the '-s' commandline option
like this: like this:
@ -96,7 +96,7 @@ prompt.
NOTE for 4, 5, 6: NOTE for 4, 5, 6:
For Vanilla you can create ubuntu, fedora and centos cloud image with 2.x.x For Vanilla you can create ubuntu, fedora and centos7 cloud image with 2.x.x
versions. Use environment variables 'DIB_HADOOP_VERSION_2' to change defaults. versions. Use environment variables 'DIB_HADOOP_VERSION_2' to change defaults.
For Spark you can create only ubuntu images, so you shouldn't specify an image For Spark you can create only ubuntu images, so you shouldn't specify an image
type. The default Spark and HDFS versions included in the build are tested and type. The default Spark and HDFS versions included in the build are tested and
@ -104,8 +104,8 @@ known working together with the Sahara Spark plugin, other combinations should
be used only for evaluation or testing purposes. You can select a different be used only for evaluation or testing purposes. You can select a different
Spark version with commandline option '-s' and Hadoop HDFS version with '-v', Spark version with commandline option '-s' and Hadoop HDFS version with '-v',
but only Cludera CDH versions are available for now. For Cloudera you can but only Cludera CDH versions are available for now. For Cloudera you can
create ubuntu and centos images with preinstalled cloudera hadoop. You create ubuntu and centos7 images with preinstalled cloudera hadoop. You
shouldn't specify hadoop version. You can create centos, ubuntu, fedora images shouldn't specify hadoop version. You can create centos7, ubuntu, fedora images
without hadoop ('plain' image) without hadoop ('plain' image)
NOTE for CentOS images (for vanilla, ambari, and cloudera plugins): NOTE for CentOS images (for vanilla, ambari, and cloudera plugins):
@ -118,7 +118,7 @@ disk space you should export parameter DIB_IMAGE_SIZE:
.. sourcecode:: bash .. sourcecode:: bash
DIB_IMAGE_SIZE=40 tox -e venv -- sahara-image-create -i centos DIB_IMAGE_SIZE=40 tox -e venv -- sahara-image-create -i centos7
For all other images parameter DIB_IMAGE_SIZE will be unset. For all other images parameter DIB_IMAGE_SIZE will be unset.

View File

@ -31,7 +31,7 @@ usage() {
echo echo
echo "Usage: $(basename $0)" echo "Usage: $(basename $0)"
echo " [-p vanilla|spark|cloudera|storm|mapr|ambari|plain]" echo " [-p vanilla|spark|cloudera|storm|mapr|ambari|plain]"
echo " [-i ubuntu|fedora|centos|centos7]" echo " [-i ubuntu|fedora|centos7]"
echo " [-v 2.7.1|2.7.5|2.8.2|5.5|5.7|5.9|5.11|2.2.0.0|2.2.1.0|2.4.2.0]" echo " [-v 2.7.1|2.7.5|2.8.2|5.5|5.7|5.9|5.11|2.2.0.0|2.2.1.0|2.4.2.0]"
echo " [-r 5.1.0|5.2.0]" echo " [-r 5.1.0|5.2.0]"
echo " [-s 1.3.1|1.6.0|2.1.0|2.2.0]" echo " [-s 1.3.1|1.6.0|2.1.0|2.2.0]"
@ -44,7 +44,7 @@ usage() {
echo " [-h]" echo " [-h]"
echo " '-p' is plugin version (default: all plugins)" echo " '-p' is plugin version (default: all plugins)"
echo " '-i' is operating system of the base image (default: all non-deprecated" echo " '-i' is operating system of the base image (default: all non-deprecated"
echo " by plugin). 'centos' images (CentOS 6) are deprecated." echo " by plugin)."
echo " '-v' is hadoop version (default: all supported by plugin)" echo " '-v' is hadoop version (default: all supported by plugin)"
echo " '-r' is MapR Version (default: ${DIB_DEFAULT_MAPR_VERSION})" echo " '-r' is MapR Version (default: ${DIB_DEFAULT_MAPR_VERSION})"
echo " '-s' is Spark version (default: ${DIB_DEFAULT_SPARK_VERSION})" echo " '-s' is Spark version (default: ${DIB_DEFAULT_SPARK_VERSION})"
@ -151,20 +151,6 @@ if [ "$DEBUG_MODE" = "true" -a "$platform" != 'ubuntu' ]; then
fi fi
fi fi
# Deprecation
if [ "$BASE_IMAGE_OS" = "centos" ]; then
echo "*************************************************"
echo "* __ ___ ____ _ _ ___ _ _ ____ *"
echo "* \ \ / / \ | _ \| \ | |_ _| \ | |/ ___| *"
echo "* \ \ /\ / / _ \ | |_) | \| || || \| | | _ *"
echo "* \ V V / ___ \| _ <| |\ || || |\ | |_| | *"
echo "* \_/\_/_/ \_\_| \_\_| \_|___|_| \_|\____| *"
echo "* *"
echo "* CentOS 6 images are deprecated ! *"
echo "* Please switch to 'centos7' *"
echo "*************************************************"
fi
check_spark_version () { check_spark_version () {
case "$DIB_SPARK_VERSION" in case "$DIB_SPARK_VERSION" in
"1.3.1" | "1.6.0" | "2.1.0" | "2.2.0");; "1.3.1" | "1.6.0" | "2.1.0" | "2.2.0");;
@ -191,7 +177,7 @@ case "$PLUGIN" in
;; ;;
esac esac
case "$BASE_IMAGE_OS" in case "$BASE_IMAGE_OS" in
"" | "ubuntu" | "fedora" | "centos" | "centos7");; "" | "ubuntu" | "fedora" | "centos7");;
*) *)
echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting" echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting"
exit 1 exit 1
@ -201,7 +187,7 @@ case "$PLUGIN" in
;; ;;
"cloudera") "cloudera")
case "$BASE_IMAGE_OS" in case "$BASE_IMAGE_OS" in
"" | "ubuntu" | "centos" | "centos7");; "" | "ubuntu" | "centos7");;
*) *)
echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting" echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting"
exit 1 exit 1
@ -266,7 +252,7 @@ case "$PLUGIN" in
;; ;;
"ambari") "ambari")
case "$BASE_IMAGE_OS" in case "$BASE_IMAGE_OS" in
"" | "centos" | "centos7" | "ubuntu" ) "" | "centos7" | "ubuntu" )
;; ;;
* ) * )
echo "\"$BASE_IMAGE_OS\" image type is not supported by \"$PLUGIN\".\nAborting" echo "\"$BASE_IMAGE_OS\" image type is not supported by \"$PLUGIN\".\nAborting"
@ -283,7 +269,7 @@ case "$PLUGIN" in
;; ;;
"mapr") "mapr")
case "$BASE_IMAGE_OS" in case "$BASE_IMAGE_OS" in
"" | "ubuntu" | "centos" | "centos7");; "" | "ubuntu" | "centos7");;
*) *)
echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting" echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting"
exit 1 exit 1
@ -310,7 +296,7 @@ case "$PLUGIN" in
;; ;;
"plain") "plain")
case "$BASE_IMAGE_OS" in case "$BASE_IMAGE_OS" in
"" | "ubuntu" | "fedora" | "centos" | "centos7");; "" | "ubuntu" | "fedora" | "centos7");;
*) *)
echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting" echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting"
exit 1 exit 1
@ -364,10 +350,6 @@ need_required_packages() {
;; ;;
"rhel" | "centos") "rhel" | "centos")
package_list="qemu-kvm qemu-img kpartx git" package_list="qemu-kvm qemu-img kpartx git"
if [ ${platform} = "centos" ]; then
# CentOS requires the python-argparse package be installed separately
package_list="$package_list python-argparse"
fi
;; ;;
*) *)
echo -e "Unknown platform '$platform' for the package list.\nAborting" echo -e "Unknown platform '$platform' for the package list.\nAborting"
@ -394,13 +376,6 @@ if need_required_packages; then
"opensuse") "opensuse")
sudo zypper --non-interactive --gpg-auto-import-keys in $package_list sudo zypper --non-interactive --gpg-auto-import-keys in $package_list
;; ;;
"fedora" | "rhel" | "centos")
if [ ${platform} = "centos" ]; then
# install EPEL repo, in order to install argparse
sudo rpm -Uvh --force http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
fi
sudo yum install $package_list -y
;;
*) *)
echo -e "Unknown platform '$platform' for installing packages.\nAborting" echo -e "Unknown platform '$platform' for installing packages.\nAborting"
exit 2 exit 2
@ -453,25 +428,11 @@ image_create() {
case "$distro" in case "$distro" in
ubuntu) elements="$elements apt-mirror" ;; ubuntu) elements="$elements apt-mirror" ;;
fedora) elements="$elements fedora-mirror" ;; fedora) elements="$elements fedora-mirror" ;;
centos | centos7) elements="$elements centos-mirror" ;; centos7) elements="$elements centos-mirror" ;;
esac esac
fi fi
# use a custom cloud image for CentOS 6
case "$distro" in
centos)
export BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-"CentOS-6.6-cloud-init-20150821.qcow2"}
export DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-"http://sahara-files.mirantis.com"}
;;
esac
disk-image-create $IMAGE_FORMAT $TRACING -o "$output" $args "$distro" $elements "$@" disk-image-create $IMAGE_FORMAT $TRACING -o "$output" $args "$distro" $elements "$@"
# cleanup
case "$distro" in
centos)
unset BASE_IMAGE_FILE DIB_CLOUD_IMAGES
;;
esac
} }
set_hive_version() { set_hive_version() {
@ -524,7 +485,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "vanilla" ]; then
ubuntu_elements_sequence="hadoop oozie mysql hive $JAVA_ELEMENT swift_hadoop spark s3_hadoop" ubuntu_elements_sequence="hadoop oozie mysql hive $JAVA_ELEMENT swift_hadoop spark s3_hadoop"
fedora_elements_sequence="hadoop oozie mysql disable-firewall hive $JAVA_ELEMENT swift_hadoop spark s3_hadoop" fedora_elements_sequence="hadoop oozie mysql disable-firewall hive $JAVA_ELEMENT swift_hadoop spark s3_hadoop"
centos_elements_sequence="hadoop oozie mysql disable-firewall hive $JAVA_ELEMENT swift_hadoop spark nc s3_hadoop"
centos7_elements_sequence="hadoop oozie mysql disable-firewall hive $JAVA_ELEMENT swift_hadoop spark nc s3_hadoop" centos7_elements_sequence="hadoop oozie mysql disable-firewall hive $JAVA_ELEMENT swift_hadoop spark nc s3_hadoop"
# Workaround for https://bugs.launchpad.net/diskimage-builder/+bug/1204824 # Workaround for https://bugs.launchpad.net/diskimage-builder/+bug/1204824
@ -536,7 +496,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "vanilla" ]; then
echo " disabled. Do not use these images in production. " echo " disabled. Do not use these images in production. "
echo "**************************************************************" echo "**************************************************************"
fedora_elements_sequence="$fedora_elements_sequence selinux-permissive" fedora_elements_sequence="$fedora_elements_sequence selinux-permissive"
centos_elements_sequence="$centos_elements_sequence selinux-permissive"
centos7_elements_sequence="$centos7_elements_sequence selinux-permissive" centos7_elements_sequence="$centos7_elements_sequence selinux-permissive"
suffix=".selinux-permissive" suffix=".selinux-permissive"
fi fi
@ -593,16 +552,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "vanilla" ]; then
fi fi
fi fi
# CentOS 6 cloud image
if [ "$BASE_IMAGE_OS" = "centos" ]; then
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "2.7.1" ]; then
export DIB_HADOOP_VERSION=${DIB_HADOOP_VERSION_2_7_1:-"2.7.1"}
export centos_image_name=${centos_vanilla_hadoop_2_7_1_image_name:-"centos_sahara_vanilla_hadoop_2_7_1_latest$suffix"}
set_hive_version
image_create centos $centos_image_name $centos_elements_sequence
fi
fi
# CentOS 7 cloud image # CentOS 7 cloud image
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "2.7.1" ]; then if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "2.7.1" ]; then
@ -703,11 +652,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "ambari" ]; then
image_create ubuntu $ambari_ubuntu_image_name $ambari_element_sequence image_create ubuntu $ambari_ubuntu_image_name $ambari_element_sequence
unset DIB_RELEASE unset DIB_RELEASE
fi fi
if [ "$BASE_IMAGE_OS" = "centos" ]; then
ambari_centos_image_name=${ambari_centos_image_name:-centos_sahara_ambari}
ambari_element_sequence="ambari $JAVA_ELEMENT disable-firewall swift_hadoop kdc nc"
image_create centos $ambari_centos_image_name $ambari_element_sequence
fi
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then
ambari_centos7_image_name=${ambari_centos7_image_name:-"centos7-sahara-ambari"} ambari_centos7_image_name=${ambari_centos7_image_name:-"centos7-sahara-ambari"}
ambari_element_sequence="disable-selinux ambari $JAVA_ELEMENT disable-firewall swift_hadoop kdc nc" ambari_element_sequence="disable-selinux ambari $JAVA_ELEMENT disable-firewall swift_hadoop kdc nc"
@ -776,18 +720,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "cloudera" ]; then
fi fi
fi fi
if [ "$BASE_IMAGE_OS" = "centos" ]; then
centos_cloudera_elements_sequence="selinux-permissive disable-firewall nc"
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.5" ]; then
export DIB_CDH_VERSION="5.5"
cloudera_5_5_centos_image_name=${cloudera_5_5_centos_image_name:-centos_sahara_cloudera_5_5_0}
image_create centos $cloudera_5_5_centos_image_name $cloudera_elements_sequence $centos_cloudera_elements_sequence
unset DIB_CDH_VERSION
fi
fi
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then
centos7_cloudera_elements_sequence="selinux-permissive disable-firewall nc" centos7_cloudera_elements_sequence="selinux-permissive disable-firewall nc"
if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.5" ]; then if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.5" ]; then
@ -859,14 +791,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "mapr" ]; then
unset DIB_RELEASE unset DIB_RELEASE
fi fi
if [ "$BASE_IMAGE_OS" = "centos" ]; then
mapr_centos_image_name=${mapr_centos_image_name:-centos_6.6_mapr_${DIB_MAPR_VERSION}_latest}
image_create centos $mapr_centos_image_name $mapr_centos_elements_sequence
unset DIB_CLOUD_INIT_DATASOURCES
fi
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then
mapr_centos7_image_name=${mapr_centos7_image_name:-centos_7_mapr_${DIB_MAPR_VERSION}_latest} mapr_centos7_image_name=${mapr_centos7_image_name:-centos_7_mapr_${DIB_MAPR_VERSION}_latest}
@ -888,7 +812,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "plain" ]; then
ubuntu_elements_sequence="$common_elements" ubuntu_elements_sequence="$common_elements"
fedora_elements_sequence="$common_elements" fedora_elements_sequence="$common_elements"
centos_elements_sequence="$common_elements disable-firewall disable-selinux nc"
centos7_elements_sequence="$common_elements disable-firewall disable-selinux nc" centos7_elements_sequence="$common_elements disable-firewall disable-selinux nc"
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "ubuntu" ]; then if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "ubuntu" ]; then
@ -903,12 +826,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "plain" ]; then
image_create fedora $plain_image_name $fedora_elements_sequence image_create fedora $plain_image_name $fedora_elements_sequence
fi fi
if [ "$BASE_IMAGE_OS" = "centos" ]; then
plain_image_name=${plain_centos_image_name:-centos_plain}
image_create centos $plain_image_name $centos_elements_sequence
fi
if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; then
plain_image_name=${plain_centos7_image_name:-centos7_plain} plain_image_name=${plain_centos7_image_name:-centos7_plain}

View File

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

View File

@ -9,9 +9,6 @@ set -o pipefail
DIB_AMBARI_VERSION="${DIB_AMBARI_VERSION:-2.4.2.0}" DIB_AMBARI_VERSION="${DIB_AMBARI_VERSION:-2.4.2.0}"
case "${DISTRO_NAME}" in 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
;;
rhel7 | 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
;; ;;

View File

@ -7,7 +7,7 @@ set -eu
set -o pipefail set -o pipefail
case "${DISTRO_NAME}" in case "${DISTRO_NAME}" in
fedora | centos | centos7 | rhel | rhel7 ) fedora | centos7 | rhel7 )
if type -p systemctl && [[ $(systemctl --no-pager list-unit-files firewalld) =~ 'enabled' ]]; then if type -p systemctl && [[ $(systemctl --no-pager list-unit-files firewalld) =~ 'enabled' ]]; then
systemctl disable firewalld systemctl disable firewalld
fi fi

View File

@ -13,7 +13,7 @@ case "$DISTRO_NAME" in
esac esac
case "${DISTRO_NAME}" in case "${DISTRO_NAME}" in
fedora | centos | rhel | rhel7) fedora | rhel7)
if type -p service; then if type -p service; then
service ip6tables save service ip6tables save
chkconfig ip6tables off chkconfig ip6tables off

View File

@ -13,7 +13,7 @@ case "$DISTRO_NAME" in
esac esac
case "${DISTRO_NAME}" in case "${DISTRO_NAME}" in
fedora | centos | rhel | rhel7) fedora | rhel7)
if type -p service; then if type -p 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 | rhel7 ) centos7 | rhel7 )
JDK_HOME=$(find /usr/java -name 'jdk*cloudera' -print) JDK_HOME=$(find /usr/java -name 'jdk*cloudera' -print)
;; ;;
ubuntu ) ubuntu )

View File

@ -36,15 +36,8 @@ function add_repo_5_5_0 {
apt-get update apt-get update
;; ;;
centos | rhel | centos7 | rhel7 ) centos7 | rhel7 )
case $DISTRO_NAME in releasever=7
centos | rhel )
releasever=6
;;
centos7 | rhel7 )
releasever=7
;;
esac
echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo
echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo
echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/5.5.0/" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/5.5.0/" >> /etc/yum.repos.d/cloudera-cdh5.repo
@ -111,15 +104,8 @@ function add_repo_5_7_x {
apt-get update apt-get update
;; ;;
centos | rhel | centos7 | rhel7 ) centos7 | rhel7 )
case $DISTRO_NAME in releasever=7
centos | rhel )
releasever=6
;;
centos7 | rhel7 )
releasever=7
;;
esac
echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo
echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo
echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/$DIB_CDH_MINOR_VERSION/" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/$DIB_CDH_MINOR_VERSION/" >> /etc/yum.repos.d/cloudera-cdh5.repo
@ -186,15 +172,8 @@ function add_repo_5_9_x {
apt-get update apt-get update
;; ;;
centos | rhel | centos7 | rhel7 ) centos7 | rhel7 )
case $DISTRO_NAME in releasever=7
centos | rhel )
releasever=6
;;
centos7 | rhel7 )
releasever=7
;;
esac
echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo
echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo
echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/$DIB_CDH_MINOR_VERSION/" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/$DIB_CDH_MINOR_VERSION/" >> /etc/yum.repos.d/cloudera-cdh5.repo
@ -261,15 +240,8 @@ function add_repo_5_11_x {
apt-get update apt-get update
;; ;;
centos | rhel | centos7 | rhel7 ) centos7 | rhel7 )
case $DISTRO_NAME in releasever=7
centos | rhel )
releasever=6
;;
centos7 | rhel7 )
releasever=7
;;
esac
echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo echo '[cloudera-cdh5]' > /etc/yum.repos.d/cloudera-cdh5.repo
echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "name=Cloudera's Distribution for Hadoop, Version 5" >> /etc/yum.repos.d/cloudera-cdh5.repo
echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/$DIB_CDH_MINOR_VERSION/" >> /etc/yum.repos.d/cloudera-cdh5.repo echo "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/$DIB_CDH_MINOR_VERSION/" >> /etc/yum.repos.d/cloudera-cdh5.repo

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|rhel|rhel7] [-r 5.1.0 | 5.2.0] diskimage-create.sh -p mapr [-i ubuntu|centos7|rhel7] [-r 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" -o "$DISTRO_NAME" = "rhel7" ]; then elif [ "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel7" ]; then
install-packages cdparanoia-libs \ install-packages cdparanoia-libs \
cups \ cups \
cups-libs \ cups-libs \

View File

@ -39,7 +39,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" -o "$DISTRO_NAME" = "rhel7" ]; then elif [ "$DISTRO_NAME" = "centos7" -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" -o "$DISTRO_NAME" = "rhel7" ]; then elif [ "$DISTRO_NAME" = "centos7" -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

@ -24,7 +24,7 @@ get_repo_url() {
repo_url="${DIB_MAPR_ECO_DEB_REPO:-http://package.mapr.com/releases/MEP/MEP-2.0.0/ubuntu/ binary trusty}" repo_url="${DIB_MAPR_ECO_DEB_REPO:-http://package.mapr.com/releases/MEP/MEP-2.0.0/ubuntu/ binary trusty}"
;; ;;
esac esac
elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" -o "$DISTRO_NAME" = "rhel7" ]; then elif [ "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel7" ]; then
case "$DIB_MAPR_VERSION" in case "$DIB_MAPR_VERSION" in
"5.1.0") "5.1.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" -o "$DISTRO_NAME" = "rhel7" ]; then if [ "$DISTRO_NAME" = "centos7" -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" -o "$DISTRO_NAME" = "rhel7" ]; then elif [ "$DISTRO_NAME" = "centos7" -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" || "$distro" == "rhel7" ]]; then elif [[ "$distro" == "centos7" || "$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" || "$distro" == "rhel7" ]]; then elif [[ "$distro" == "centos7" || "$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" || "$distro" == "rhel7" ]]; then elif [[ "$distro" == "centos7" || "$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" || "$distro" == "rhel7" ]]; then elif [[ "$distro" == "centos7" || "$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" || "$distro" == "rhel7" ]]; then elif [[ "$distro" == "centos7" || "$distro" == "rhel7" ]]; then
remove_yum_repo "$repo_name" remove_yum_repo "$repo_name"
fi fi
} }

View File

@ -76,7 +76,7 @@ EOF
} }
case "$DISTRO_NAME" in case "$DISTRO_NAME" in
fedora | ubuntu | rhel | rhel7 | centos | centos7 ) fedora | ubuntu | rhel7 | centos7 )
;; ;;
*) *)
echo "Unknown distro: $DISTRO_NAME. Exiting." echo "Unknown distro: $DISTRO_NAME. Exiting."
@ -94,7 +94,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 | rhel7 | centos | centos7 ) fedora | rhel7 | centos7 )
adduser -G adm,wheel hadoop adduser -G adm,wheel hadoop
;; ;;
esac esac

View File

@ -35,9 +35,6 @@ function firstboot_common {
;; ;;
CentOS ) CentOS )
case "$(lsb_release -rs)" in case "$(lsb_release -rs)" in
6.*)
chown -R cloud-user:cloud-user /home/cloud-user
;;
7.*) 7.*)
chown -R centos:centos /home/centos chown -R centos:centos /home/centos
;; ;;

View File

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

View File

@ -1,5 +1,5 @@
case "${DISTRO_NAME}" in case "${DISTRO_NAME}" in
centos | centos7 | rhel | rhel7 | fedora ) centos7 | 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 | centos7 | rhel | rhel7 ) centos7 | 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 | rhel7 | centos | centos7 ) fedora | rhel7 | 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 | rhel7 | centos | centos7 ) fedora | rhel7 | centos7 )
mkdir -p /etc/mysql/conf.d mkdir -p /etc/mysql/conf.d
;; ;;
esac esac

View File

@ -10,9 +10,6 @@ echo "Installing OpenJDK"
default_jdk_version_for_distro () { default_jdk_version_for_distro () {
case "$DISTRO_NAME" in case "$DISTRO_NAME" in
centos | rhel )
echo "7"
;;
fedora ) fedora )
if [ $(lsb_release -rs) -ge '21' ]; then if [ $(lsb_release -rs) -ge '21' ]; then
echo "8" echo "8"
@ -48,7 +45,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 | rhel7 | centos | centos7 ) fedora | rhel7 | 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

@ -45,7 +45,7 @@ set /files/etc/ssh/sshd_config/PubkeyAuthentication yes
save save
EOF EOF
;; ;;
rhel | rhel7 | centos | centos7 ) rhel7 | 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