From 5d05a3db2f99ef70c32c0b53a29f62f5e38cebe5 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Tue, 15 May 2018 18:22:50 +0200 Subject: [PATCH] Remove CentOS6/RHEL6 support Deprecated in Pike, and removed from diskimage-builder for a while. Story: 2001996 Task: 19626 Change-Id: I9b4eab56fcbfcb2e97805fba805eafeeafa5d540 --- .../Create_CentOS_cloud_image.rst | 80 --------------- diskimage-create/README.rst | 22 ++--- diskimage-create/diskimage-create.sh | 99 ++----------------- .../ambari/post-install.d/10-disable-ambari | 2 +- .../ambari/pre-install.d/90-ambari-repo-conf | 3 - .../post-install.d/30-disable-firewalld | 2 +- .../post-install.d/31-disable-ip6tables | 2 +- .../post-install.d/32-disable-iptables | 2 +- elements/hadoop-cloudera/install.d/34-java | 2 +- .../pre-install.d/10-add-mirror | 44 ++------- elements/hadoop-mapr/README.rst | 2 +- .../install.d/40-mapr-dependencies | 2 +- elements/hadoop-mapr/install.d/41-scala | 2 +- .../install.d/43-mapr-core-repository | 2 +- .../install.d/44-mapr-eco-repository | 2 +- .../hadoop-mapr/post-install.d/99-requiretty | 2 +- .../post-install.d/99-update-repository | 2 +- .../hadoop-mapr/resources/package_utils.sh | 10 +- elements/hadoop/install.d/40-setup-hadoop | 4 +- elements/hadoop/install.d/firstboot | 3 - elements/hadoop/root.d/50-download-hadoop | 2 +- .../99-set-up-default-apache-dir | 2 +- .../install.d/10-enable-apache | 2 +- elements/java/bin/setup-java-home | 2 +- elements/mysql/install.d/10-mysql | 2 +- elements/openjdk/install.d/33-java | 5 +- elements/ssh/install.d/33-ssh | 2 +- 27 files changed, 53 insertions(+), 253 deletions(-) delete mode 100644 diskimage-create/Create_CentOS_cloud_image.rst diff --git a/diskimage-create/Create_CentOS_cloud_image.rst b/diskimage-create/Create_CentOS_cloud_image.rst deleted file mode 100644 index 2e6517a3..00000000 --- a/diskimage-create/Create_CentOS_cloud_image.rst +++ /dev/null @@ -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 `_ diff --git a/diskimage-create/README.rst b/diskimage-create/README.rst index 82d70295..33c2659d 100644 --- a/diskimage-create/README.rst +++ b/diskimage-create/README.rst @@ -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' 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, -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. For users: @@ -14,12 +14,12 @@ For users: Environment variables the script accepts are 'DIB_HADOOP_VERSION_2_7_1', 'JAVA_DOWNLOAD_URL', 'JAVA_TARGET_LOCATION', 'OOZIE_DOWNLOAD_URL', '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', -'ambari_[ubuntu|centos|centos7]_image_name', -'cloudera_[5_5|5_7|5_9]_[ubuntu|centos]_image_name', -'mapr_[ubuntu|centos|centos7]_image_name', -'plain_[ubuntu|fedora|centos|centos7]_image_name'. +'ambari_[ubuntu|centos7]_image_name', +'cloudera_[5_7|5_9|5_11]_[ubuntu|centos7]_image_name', +'mapr_[ubuntu|centos7]_image_name', +'plain_[ubuntu|fedora|centos7]_image_name'. 2. For creating all images just clone this repository and run script. @@ -73,7 +73,7 @@ like this: .. 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 like this: @@ -96,7 +96,7 @@ prompt. 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. 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 @@ -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 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 -create ubuntu and centos images with preinstalled cloudera hadoop. You -shouldn't specify hadoop version. You can create centos, ubuntu, fedora images +create ubuntu and centos7 images with preinstalled cloudera hadoop. You +shouldn't specify hadoop version. You can create centos7, ubuntu, fedora images without hadoop ('plain' image) 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 - 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. diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index e8441c93..6d1976e5 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -31,7 +31,7 @@ usage() { echo echo "Usage: $(basename $0)" 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 " [-r 5.1.0|5.2.0]" echo " [-s 1.3.1|1.6.0|2.1.0|2.2.0]" @@ -44,7 +44,7 @@ usage() { echo " [-h]" echo " '-p' is plugin version (default: all plugins)" 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 " '-r' is MapR Version (default: ${DIB_DEFAULT_MAPR_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 -# 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 () { case "$DIB_SPARK_VERSION" in "1.3.1" | "1.6.0" | "2.1.0" | "2.2.0");; @@ -191,7 +177,7 @@ case "$PLUGIN" in ;; esac 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" exit 1 @@ -201,7 +187,7 @@ case "$PLUGIN" in ;; "cloudera") case "$BASE_IMAGE_OS" in - "" | "ubuntu" | "centos" | "centos7");; + "" | "ubuntu" | "centos7");; *) echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting" exit 1 @@ -266,7 +252,7 @@ case "$PLUGIN" in ;; "ambari") case "$BASE_IMAGE_OS" in - "" | "centos" | "centos7" | "ubuntu" ) + "" | "centos7" | "ubuntu" ) ;; * ) echo "\"$BASE_IMAGE_OS\" image type is not supported by \"$PLUGIN\".\nAborting" @@ -283,7 +269,7 @@ case "$PLUGIN" in ;; "mapr") case "$BASE_IMAGE_OS" in - "" | "ubuntu" | "centos" | "centos7");; + "" | "ubuntu" | "centos7");; *) echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting" exit 1 @@ -310,7 +296,7 @@ case "$PLUGIN" in ;; "plain") 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" exit 1 @@ -364,10 +350,6 @@ need_required_packages() { ;; "rhel" | "centos") 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" @@ -394,13 +376,6 @@ if need_required_packages; then "opensuse") 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" exit 2 @@ -453,25 +428,11 @@ image_create() { case "$distro" in ubuntu) elements="$elements apt-mirror" ;; fedora) elements="$elements fedora-mirror" ;; - centos | centos7) elements="$elements centos-mirror" ;; + centos7) elements="$elements centos-mirror" ;; esac 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 "$@" - - # cleanup - case "$distro" in - centos) - unset BASE_IMAGE_FILE DIB_CLOUD_IMAGES - ;; - esac } 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" 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" # 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 "**************************************************************" fedora_elements_sequence="$fedora_elements_sequence selinux-permissive" - centos_elements_sequence="$centos_elements_sequence selinux-permissive" centos7_elements_sequence="$centos7_elements_sequence selinux-permissive" suffix=".selinux-permissive" fi @@ -593,16 +552,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "vanilla" ]; then 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 if [ -z "$BASE_IMAGE_OS" -o "$BASE_IMAGE_OS" = "centos7" ]; 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 unset DIB_RELEASE 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 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" @@ -776,18 +720,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "cloudera" ]; then 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 centos7_cloudera_elements_sequence="selinux-permissive disable-firewall nc" if [ -z "$HADOOP_VERSION" -o "$HADOOP_VERSION" = "5.5" ]; then @@ -859,14 +791,6 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "mapr" ]; then unset DIB_RELEASE 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 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" 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" 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 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 plain_image_name=${plain_centos7_image_name:-centos7_plain} diff --git a/elements/ambari/post-install.d/10-disable-ambari b/elements/ambari/post-install.d/10-disable-ambari index f6712636..e7841f74 100755 --- a/elements/ambari/post-install.d/10-disable-ambari +++ b/elements/ambari/post-install.d/10-disable-ambari @@ -7,7 +7,7 @@ set -eu set -o pipefail case "${DISTRO_NAME}" in - rhel | rhel7 | centos | centos7 ) + rhel7 | centos7 ) chkconfig ambari-server off chkconfig ambari-agent off ;; diff --git a/elements/ambari/pre-install.d/90-ambari-repo-conf b/elements/ambari/pre-install.d/90-ambari-repo-conf index 6ed3c38d..46d5d483 100755 --- a/elements/ambari/pre-install.d/90-ambari-repo-conf +++ b/elements/ambari/pre-install.d/90-ambari-repo-conf @@ -9,9 +9,6 @@ set -o pipefail DIB_AMBARI_VERSION="${DIB_AMBARI_VERSION:-2.4.2.0}" 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 ) wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/$DIB_AMBARI_VERSION/ambari.repo -O /etc/yum.repos.d/ambari.repo ;; diff --git a/elements/disable-firewall/post-install.d/30-disable-firewalld b/elements/disable-firewall/post-install.d/30-disable-firewalld index 9aac9aab..39a4aa67 100755 --- a/elements/disable-firewall/post-install.d/30-disable-firewalld +++ b/elements/disable-firewall/post-install.d/30-disable-firewalld @@ -7,7 +7,7 @@ set -eu set -o pipefail 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 systemctl disable firewalld fi diff --git a/elements/disable-firewall/post-install.d/31-disable-ip6tables b/elements/disable-firewall/post-install.d/31-disable-ip6tables index d8f607ed..4fda2a56 100755 --- a/elements/disable-firewall/post-install.d/31-disable-ip6tables +++ b/elements/disable-firewall/post-install.d/31-disable-ip6tables @@ -13,7 +13,7 @@ case "$DISTRO_NAME" in esac case "${DISTRO_NAME}" in - fedora | centos | rhel | rhel7) + fedora | rhel7) if type -p service; then service ip6tables save chkconfig ip6tables off diff --git a/elements/disable-firewall/post-install.d/32-disable-iptables b/elements/disable-firewall/post-install.d/32-disable-iptables index 2ef50211..5eb6a5ab 100755 --- a/elements/disable-firewall/post-install.d/32-disable-iptables +++ b/elements/disable-firewall/post-install.d/32-disable-iptables @@ -13,7 +13,7 @@ case "$DISTRO_NAME" in esac case "${DISTRO_NAME}" in - fedora | centos | rhel | rhel7) + fedora | rhel7) if type -p service; then service iptables save chkconfig iptables off diff --git a/elements/hadoop-cloudera/install.d/34-java b/elements/hadoop-cloudera/install.d/34-java index 69712305..5f479c4f 100755 --- a/elements/hadoop-cloudera/install.d/34-java +++ b/elements/hadoop-cloudera/install.d/34-java @@ -14,7 +14,7 @@ if [ -z "${DIB_CDH_HDFS_ONLY:-}" ]; then JDK_HOME="" case $DISTRO_NAME in - centos | centos7 | rhel | rhel7 ) + centos7 | rhel7 ) JDK_HOME=$(find /usr/java -name 'jdk*cloudera' -print) ;; ubuntu ) diff --git a/elements/hadoop-cloudera/pre-install.d/10-add-mirror b/elements/hadoop-cloudera/pre-install.d/10-add-mirror index 04e88bd6..66ba3233 100755 --- a/elements/hadoop-cloudera/pre-install.d/10-add-mirror +++ b/elements/hadoop-cloudera/pre-install.d/10-add-mirror @@ -36,15 +36,8 @@ function add_repo_5_5_0 { apt-get update ;; - centos | rhel | centos7 | rhel7 ) - case $DISTRO_NAME in - centos | rhel ) - releasever=6 - ;; - centos7 | rhel7 ) - releasever=7 - ;; - esac + centos7 | rhel7 ) + releasever=7 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 "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 ;; - centos | rhel | centos7 | rhel7 ) - case $DISTRO_NAME in - centos | rhel ) - releasever=6 - ;; - centos7 | rhel7 ) - releasever=7 - ;; - esac + centos7 | rhel7 ) + releasever=7 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 "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 ;; - centos | rhel | centos7 | rhel7 ) - case $DISTRO_NAME in - centos | rhel ) - releasever=6 - ;; - centos7 | rhel7 ) - releasever=7 - ;; - esac + centos7 | rhel7 ) + releasever=7 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 "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 ;; - centos | rhel | centos7 | rhel7 ) - case $DISTRO_NAME in - centos | rhel ) - releasever=6 - ;; - centos7 | rhel7 ) - releasever=7 - ;; - esac + centos7 | rhel7 ) + releasever=7 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 "baseurl=http://archive.cloudera.com/cdh5/redhat/$releasever/x86_64/cdh/$DIB_CDH_MINOR_VERSION/" >> /etc/yum.repos.d/cloudera-cdh5.repo diff --git a/elements/hadoop-mapr/README.rst b/elements/hadoop-mapr/README.rst index a4ebd4e9..1a4534b9 100644 --- a/elements/hadoop-mapr/README.rst +++ b/elements/hadoop-mapr/README.rst @@ -13,7 +13,7 @@ following syntax to select the ``MapR`` plugin: .. 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 repositories and specify environment variables: diff --git a/elements/hadoop-mapr/install.d/40-mapr-dependencies b/elements/hadoop-mapr/install.d/40-mapr-dependencies index 2b4bf550..0a5d53ac 100755 --- a/elements/hadoop-mapr/install.d/40-mapr-dependencies +++ b/elements/hadoop-mapr/install.d/40-mapr-dependencies @@ -64,7 +64,7 @@ EOF watchdog \ zlib1g-dev \ 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 \ cups \ cups-libs \ diff --git a/elements/hadoop-mapr/install.d/41-scala b/elements/hadoop-mapr/install.d/41-scala index 1ddd0355..ea83e91f 100755 --- a/elements/hadoop-mapr/install.d/41-scala +++ b/elements/hadoop-mapr/install.d/41-scala @@ -39,7 +39,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" -o "$DISTRO_NAME" = "rhel7" ]; then +elif [ "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel7" ]; then rpm -Uhv ${URL}/${PKG}.rpm fi diff --git a/elements/hadoop-mapr/install.d/43-mapr-core-repository b/elements/hadoop-mapr/install.d/43-mapr-core-repository index c24fc470..b23033ec 100755 --- a/elements/hadoop-mapr/install.d/43-mapr-core-repository +++ b/elements/hadoop-mapr/install.d/43-mapr-core-repository @@ -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" -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}" fi diff --git a/elements/hadoop-mapr/install.d/44-mapr-eco-repository b/elements/hadoop-mapr/install.d/44-mapr-eco-repository index d40d018f..013ab54e 100755 --- a/elements/hadoop-mapr/install.d/44-mapr-eco-repository +++ b/elements/hadoop-mapr/install.d/44-mapr-eco-repository @@ -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}" ;; 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 "5.1.0") repo_url="${DIB_MAPR_ECO_RPM_REPO:-http://package.mapr.com/releases/ecosystem-5.x/redhat}" diff --git a/elements/hadoop-mapr/post-install.d/99-requiretty b/elements/hadoop-mapr/post-install.d/99-requiretty index fde0879b..c961661c 100755 --- a/elements/hadoop-mapr/post-install.d/99-requiretty +++ b/elements/hadoop-mapr/post-install.d/99-requiretty @@ -6,7 +6,7 @@ fi set -eu 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 fi diff --git a/elements/hadoop-mapr/post-install.d/99-update-repository b/elements/hadoop-mapr/post-install.d/99-update-repository index 326a80d0..f39496a4 100755 --- a/elements/hadoop-mapr/post-install.d/99-update-repository +++ b/elements/hadoop-mapr/post-install.d/99-update-repository @@ -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" -o "$DISTRO_NAME" = "rhel7" ]; then +elif [ "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel7" ]; then yum clean all && yum repolist fi diff --git a/elements/hadoop-mapr/resources/package_utils.sh b/elements/hadoop-mapr/resources/package_utils.sh index 56e52cf1..8ebd2599 100644 --- a/elements/hadoop-mapr/resources/package_utils.sh +++ b/elements/hadoop-mapr/resources/package_utils.sh @@ -40,7 +40,7 @@ download_package() { if [[ "$distro" == "ubuntu" ]]; then 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" fi } @@ -93,7 +93,7 @@ create_repo() { if [[ "$distro" == "ubuntu" ]]; then create_apt_repo "$directory" - elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" || "$distro" == "rhel7" ]]; then + elif [[ "$distro" == "centos7" || "$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" || "$distro" == "rhel7" ]]; then + elif [[ "$distro" == "centos7" || "$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" || "$distro" == "rhel7" ]]; then + elif [[ "$distro" == "centos7" || "$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" || "$distro" == "rhel7" ]]; then + elif [[ "$distro" == "centos7" || "$distro" == "rhel7" ]]; then remove_yum_repo "$repo_name" fi } diff --git a/elements/hadoop/install.d/40-setup-hadoop b/elements/hadoop/install.d/40-setup-hadoop index ac99d34f..e483f1cf 100755 --- a/elements/hadoop/install.d/40-setup-hadoop +++ b/elements/hadoop/install.d/40-setup-hadoop @@ -76,7 +76,7 @@ EOF } case "$DISTRO_NAME" in - fedora | ubuntu | rhel | rhel7 | centos | centos7 ) + fedora | ubuntu | rhel7 | centos7 ) ;; *) echo "Unknown distro: $DISTRO_NAME. Exiting." @@ -94,7 +94,7 @@ case "$DISTRO_NAME" in adduser --ingroup hadoop --disabled-password --gecos GECOS hadoop adduser hadoop sudo ;; - fedora | rhel | rhel7 | centos | centos7 ) + fedora | rhel7 | centos7 ) adduser -G adm,wheel hadoop ;; esac diff --git a/elements/hadoop/install.d/firstboot b/elements/hadoop/install.d/firstboot index 5eec4911..dff9ec56 100644 --- a/elements/hadoop/install.d/firstboot +++ b/elements/hadoop/install.d/firstboot @@ -35,9 +35,6 @@ function firstboot_common { ;; CentOS ) case "$(lsb_release -rs)" in - 6.*) - chown -R cloud-user:cloud-user /home/cloud-user - ;; 7.*) chown -R centos:centos /home/centos ;; diff --git a/elements/hadoop/root.d/50-download-hadoop b/elements/hadoop/root.d/50-download-hadoop index 4cdb78d9..6ce32fdf 100755 --- a/elements/hadoop/root.d/50-download-hadoop +++ b/elements/hadoop/root.d/50-download-hadoop @@ -19,7 +19,7 @@ function download_hadoop_v2 { } case "$DISTRO_NAME" in - fedora | ubuntu | rhel | rhel7 | centos | centos7 ) + fedora | ubuntu | rhel7 | centos7 ) ;; *) echo "Unknown distro: $DISTRO_NAME. Exiting." diff --git a/elements/hdp-local-mirror/environment.d/99-set-up-default-apache-dir b/elements/hdp-local-mirror/environment.d/99-set-up-default-apache-dir index 89a29216..8e13b516 100644 --- a/elements/hdp-local-mirror/environment.d/99-set-up-default-apache-dir +++ b/elements/hdp-local-mirror/environment.d/99-set-up-default-apache-dir @@ -1,5 +1,5 @@ case "${DISTRO_NAME}" in - centos | centos7 | rhel | rhel7 | fedora ) + centos7 | rhel7 | fedora ) export DIB_DEFAULT_APACHE_DIR="/var/www/html" ;; ubuntu ) diff --git a/elements/hdp-local-mirror/install.d/10-enable-apache b/elements/hdp-local-mirror/install.d/10-enable-apache index da0e621f..324d2cf3 100755 --- a/elements/hdp-local-mirror/install.d/10-enable-apache +++ b/elements/hdp-local-mirror/install.d/10-enable-apache @@ -7,7 +7,7 @@ set -eu set -o pipefail case "${DISTRO_NAME}" in - centos | centos7 | rhel | rhel7 ) + centos7 | rhel7 ) chkconfig httpd on ;; esac diff --git a/elements/java/bin/setup-java-home b/elements/java/bin/setup-java-home index fe48dfd2..846ae0bf 100755 --- a/elements/java/bin/setup-java-home +++ b/elements/java/bin/setup-java-home @@ -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 | rhel7 | centos | centos7 ) + fedora | rhel7 | centos7 ) alternatives --install /usr/bin/java java $JRE_HOME/bin/java 200000 alternatives --install /usr/bin/javac javac $JDK_HOME/bin/javac 200000 ;; diff --git a/elements/mysql/install.d/10-mysql b/elements/mysql/install.d/10-mysql index cef2963a..e8281d6d 100755 --- a/elements/mysql/install.d/10-mysql +++ b/elements/mysql/install.d/10-mysql @@ -7,7 +7,7 @@ set -eu set -o pipefail case "$DISTRO_NAME" in - fedora | rhel | rhel7 | centos | centos7 ) + fedora | rhel7 | centos7 ) mkdir -p /etc/mysql/conf.d ;; esac diff --git a/elements/openjdk/install.d/33-java b/elements/openjdk/install.d/33-java index d7ec23e3..26920694 100755 --- a/elements/openjdk/install.d/33-java +++ b/elements/openjdk/install.d/33-java @@ -10,9 +10,6 @@ echo "Installing OpenJDK" default_jdk_version_for_distro () { case "$DISTRO_NAME" in - centos | rhel ) - echo "7" - ;; fedora ) if [ $(lsb_release -rs) -ge '21' ]; then echo "8" @@ -48,7 +45,7 @@ case "$DISTRO_NAME" in JDK_PATH=$(update-alternatives --list 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 # on CentOS, Fedora and RHEL JRE_HOME="/usr/lib/jvm/java-openjdk/jre" diff --git a/elements/ssh/install.d/33-ssh b/elements/ssh/install.d/33-ssh index b71a8e09..5582c6e5 100755 --- a/elements/ssh/install.d/33-ssh +++ b/elements/ssh/install.d/33-ssh @@ -45,7 +45,7 @@ set /files/etc/ssh/sshd_config/PubkeyAuthentication yes save EOF ;; - rhel | rhel7 | centos | centos7 ) + rhel7 | centos7 ) sed -i 's/ssh_pwauth: 0/ssh_pwauth: 1/' /etc/cloud/cloud.cfg augtool <