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:
parent
ec50d50387
commit
feff7a5b87
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
################
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue