Adding ability to create CentOS7 images with MapR

This patch enables the creation of CentOS7 images with MapR plugin.

Change-Id: I915ca1f0f5e890e9b32b64d0d9e31061b7fe5f2c
This commit is contained in:
Telles Nobrega 2016-08-24 15:05:06 -03:00
parent ec50d50387
commit feff7a5b87
10 changed files with 23 additions and 14 deletions

View File

@ -18,7 +18,7 @@ Environment variables the script accepts are 'DIB_HADOOP_VERSION_2_7_1',
'ubuntu_spark_image_name', 'ubuntu_storm_image_name', 'ubuntu_spark_image_name', 'ubuntu_storm_image_name',
'ambari_[ubuntu|centos|centos7]_image_name', 'ambari_[ubuntu|centos|centos7]_image_name',
'cloudera_[5_0|5_3|5_4|5_5]_[ubuntu|centos]_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'. 'plain_[ubuntu|fedora|centos|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.

View File

@ -276,7 +276,7 @@ case "$PLUGIN" in
;; ;;
"mapr") "mapr")
case "$BASE_IMAGE_OS" in case "$BASE_IMAGE_OS" in
"" | "ubuntu" | "centos");; "" | "ubuntu" | "centos" | "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
@ -790,6 +790,15 @@ if [ -z "$PLUGIN" -o "$PLUGIN" = "mapr" ]; then
unset DIB_CLOUD_INIT_DATASOURCES unset DIB_CLOUD_INIT_DATASOURCES
fi 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 fi
################ ################

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] [-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 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" = "rhel" ]; then elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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" = "rhel" ]; then elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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" = "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}" 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" = "rhel" ]; then elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; then
case "$DIB_MAPR_VERSION" in case "$DIB_MAPR_VERSION" in
"5.0.0"|"5.1.0") "5.0.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" = "rhel" ]; then if [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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" = "rhel" ]; then elif [ "$DISTRO_NAME" = "centos" -o "$DISTRO_NAME" = "centos7" -o "$DISTRO_NAME" = "rhel" ]; 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" == "rhel" ]]; then elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; 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" == "rhel" ]]; then elif [[ "$distro" == "centos" || "$distro" == "centos7" || "$distro" == "rhel" ]]; then
remove_yum_repo "$repo_name" remove_yum_repo "$repo_name"
fi fi
} }