diff --git a/diskimage-create/README.rst b/diskimage-create/README.rst index 651857bc..2616ca05 100644 --- a/diskimage-create/README.rst +++ b/diskimage-create/README.rst @@ -18,7 +18,7 @@ Environment variables the script accepts are 'DIB_HADOOP_VERSION_2_7_1', 'ubuntu_spark_image_name', 'ubuntu_storm_image_name', 'ambari_[ubuntu|centos|centos7]_image_name', 'cloudera_[5_0|5_3|5_4|5_5]_[ubuntu|centos]_image_name', -'mapr_[ubuntu|centos]_image_name', +'mapr_[ubuntu|centos|centos7]_image_name', 'plain_[ubuntu|fedora|centos|centos7]_image_name'. 2. For creating all images just clone this repository and run script. diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 4017324c..6637cbe3 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -276,7 +276,7 @@ case "$PLUGIN" in ;; "mapr") case "$BASE_IMAGE_OS" in - "" | "ubuntu" | "centos");; + "" | "ubuntu" | "centos" | "centos7");; *) echo -e "'$BASE_IMAGE_OS' image type is not supported by '$PLUGIN'.\nAborting" exit 1 @@ -790,6 +790,15 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "mapr" ]; then 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} + + image_create centos7 $mapr_centos7_image_name $mapr_centos_elements_sequence + + unset DIB_CLOUD_INIT_DATASOURCES + fi + fi ################ diff --git a/elements/hadoop-mapr/README.rst b/elements/hadoop-mapr/README.rst index eb8110f6..7b8d89a8 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] [-r 5.0.0 | 5.1.0] + diskimage-create.sh -p mapr [-i ubuntu|centos|centos7] [-r 5.0.0 | 5.1.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 9e227c5a..e13a51e1 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" = "rhel" ]; then +elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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 366a1297..243f9166 100755 --- a/elements/hadoop-mapr/install.d/41-scala +++ b/elements/hadoop-mapr/install.d/41-scala @@ -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" = "rhel" ]; then +elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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 984de190..8d479d86 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" = "rhel" ]; then + elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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 d1a6da07..fe653526 100755 --- a/elements/hadoop-mapr/install.d/44-mapr-eco-repository +++ b/elements/hadoop-mapr/install.d/44-mapr-eco-repository @@ -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" = "rhel" ]; then + elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then case "$DIB_MAPR_VERSION" in "5.0.0"|"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 7d721162..a01d1575 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" = "rhel" ]; then +if [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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 56cda940..e9317b79 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" = "rhel" ]; then +elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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 d3560b11..0a407646 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" == "rhel" ]]; then + elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then + elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then + elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then + elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then + elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; then remove_yum_repo "$repo_name" fi }