Add rpm and iso source for Tsinghua
Change-Id: I5627c3c4bbe69c17f56a8e2ac351e4c4e4d18f03
This commit is contained in:
parent
3c277ba890
commit
a86730d5b3
@ -227,7 +227,11 @@ wget-1.12-1.8.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_I
|
||||
ntpdate-4.2.6p5-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_IMAGE_TYPE,,}.${CENTOS_IMAGE_ARCH}.rpm
|
||||
yum-plugin-priorities-1.1.30-14.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.noarch.rpm"
|
||||
for f in $centos_ppa_repo_packages; do
|
||||
download ftp://rpmfind.net/linux/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/os/${CENTOS_IMAGE_ARCH}/Packages/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
if [ "$REGION" == "asia" ]; then
|
||||
download http://mirrors.yun-idc.com/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/os/${CENTOS_IMAGE_ARCH}/Packages/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
else
|
||||
download ftp://rpmfind.net/linux/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/os/${CENTOS_IMAGE_ARCH}/Packages/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
fi
|
||||
done
|
||||
|
||||
centos_ppa_repo_rsyslog_packages="
|
||||
@ -237,7 +241,11 @@ libgt-0.3.11-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_
|
||||
liblogging-1.0.4-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_IMAGE_ARCH}.rpm
|
||||
rsyslog-7.6.3-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_IMAGE_ARCH}.rpm"
|
||||
for f in $centos_ppa_repo_rsyslog_packages; do
|
||||
download http://rpms.adiscon.com/v7-stable/epel-${CENTOS_IMAGE_VERSION_MAJOR}/${CENTOS_IMAGE_ARCH}/RPMS/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
if [ "$REGION" == "asia" ]; then
|
||||
download http://mirrors.yun-idc.com/epel/${CENTOS_IMAGE_VERSION_MAJOR}/${CENTOS_IMAGE_ARCH}/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
else
|
||||
download http://rpms.adiscon.com/v7-stable/epel-${CENTOS_IMAGE_VERSION_MAJOR}/${CENTOS_IMAGE_ARCH}/RPMS/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
fi
|
||||
done
|
||||
|
||||
# download chef client for centos ppa repo
|
||||
@ -316,7 +324,11 @@ fi
|
||||
|
||||
# import cobbler distro
|
||||
sudo mkdir -p /var/lib/cobbler/iso
|
||||
download "$CENTOS_IMAGE_SOURCE" ${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso copy /var/lib/cobbler/iso/ || exit $?
|
||||
if [ "$REGION" == "asia" ]; then
|
||||
download "$CENTOS_IMAGE_SOURCE_ASIA" ${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso copy /var/lib/cobbler/iso/ || exit $?
|
||||
else
|
||||
download "$CENTOS_IMAGE_SOURCE" ${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso copy /var/lib/cobbler/iso/ || exit $?
|
||||
fi
|
||||
sudo mkdir -p /mnt/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}
|
||||
if [ $(mount | grep -c "/mnt/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH} ") -eq 0 ]; then
|
||||
sudo mount -o loop /var/lib/cobbler/iso/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso /mnt/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}
|
||||
@ -329,8 +341,11 @@ if [ $(mount | grep -c "/mnt/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH} ") -eq 0
|
||||
else
|
||||
echo "/mnt/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH} has already mounted"
|
||||
fi
|
||||
|
||||
download "$UBUNTU_IMAGE_SOURCE" ${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso copy /var/lib/cobbler/iso/ || exit $?
|
||||
if [ "$REGION" == "asia" ]; then
|
||||
download "$UBUNTU_IMAGE_SOURCE_ASIA" ${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso copy /var/lib/cobbler/iso/ || exit $?
|
||||
else
|
||||
download "$UBUNTU_IMAGE_SOURCE" ${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso copy /var/lib/cobbler/iso/ || exit $?
|
||||
fi
|
||||
sudo mkdir -p /mnt/${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}
|
||||
if [ $(mount | grep -c "/mnt/${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH} ") -eq 0 ]; then
|
||||
sudo mount -o loop /var/lib/cobbler/iso/${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso /mnt/${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}
|
||||
|
@ -48,7 +48,7 @@ export CENTOS_IMAGE_VERSION=${CENTOS_IMAGE_VERSION:-"${CENTOS_IMAGE_VERSION_MAJO
|
||||
export CENTOS_IMAGE_NAME=${CENTOS_IMAGE_NAME:-"${CENTOS_IMAGE_TYPE}-${CENTOS_IMAGE_VERSION}"}
|
||||
export CENTOS_IMAGE_ARCH=${CENTOS_IMAGE_ARCH:-"x86_64"}
|
||||
export CENTOS_IMAGE_SOURCE=${CENTOS_IMAGE_SOURCE:-"http://mirror.rackspace.com/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/isos/${CENTOS_IMAGE_ARCH}/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}-minimal.iso"}
|
||||
|
||||
export CENTOS_IMAGE_SOURCE_ASIA=${CENTOS_IMAGE_SOURCE_ASIA:-"http://mirrors.yun-idc.com/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/isos/${CENTOS_IMAGE_ARCH}/${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}-minimal.iso"}
|
||||
export UBUNTU_IMAGE_TYPE=${UBUNTU_IMAGE_TYPE:-"Ubuntu"}
|
||||
export UBUNTU_IMAGE_VERSION_MAJOR=${UBUNTU_IMAGE_VERSION_MAJOR:-"12"}
|
||||
export UBUNTU_IMAGE_VERSION_MINOR=${UBUNTU_IMAGE_VERSION_MINOR:-"04"}
|
||||
@ -58,6 +58,7 @@ export UBUNTU_IMAGE_NAME=${UBUNTU_IMAGE_NAME:-"${UBUNTU_IMAGE_TYPE}-${UBUNTU_IMA
|
||||
export UBUNTU_IMAGE_ARCH=${UBUNTU_IMAGE_ARCH:-"x86_64"}
|
||||
export UBUNTU_IMAGE_ARCH_OTHER=${UBUNTU_IMAGE_ARCH_OTHER:-"amd64"}
|
||||
export UBUNTU_IMAGE_SOURCE=${UBUNTU_IMAGE_SOURCE:-"http://releases.ubuntu.com/${UBUNTU_IMAGE_VERSION}/${UBUNTU_IMAGE_TYPE,,}-${UBUNTU_IMAGE_VERSION}${UBUNTU_IMAGE_PATCH_VERSION}-server-${UBUNTU_IMAGE_ARCH_OTHER}.iso"}
|
||||
export UBUNTU_IMAGE_SOURCE_ASIA=${UBUNTU_IMAGE_SOURCE:-"http://mirros.ustc.edu.cn/ubuntu-releases/${UBUNTU_IMAGE_VERSION}/${UBUNTU_IMAGE_TYPE,,}-${UBUNTU_IMAGE_VERSION}${UBUNTU_IMAGE_PATCH_VERSION}-server-${UBUNTU_IMAGE_ARCH_OTHER}.iso"}
|
||||
|
||||
export COBBLER_PASSWORD=${COBBLER_PASSWORD:-"cobbler"}
|
||||
|
||||
|
@ -158,6 +158,9 @@ loadvars()
|
||||
done
|
||||
fi
|
||||
}
|
||||
echo -e "\x1b[32mAvailable Regions are asia/america, other REGIONs please use default: america\x1b[37m"
|
||||
loadvars REGION "america"
|
||||
|
||||
|
||||
loadvars NIC "eth0"
|
||||
sudo ifconfig $NIC
|
||||
|
@ -220,7 +220,11 @@ ntpdate-4.2.6p5-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENT
|
||||
yum-plugin-priorities-1.1.30-14.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.noarch.rpm"
|
||||
|
||||
for f in $centos_ppa_repo_packages; do
|
||||
download http://rpmfind.net/linux/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/os/${CENTOS_IMAGE_ARCH}/Packages/$f $f || exit $?
|
||||
if [ "$REGION" == "asia" ]; then
|
||||
download http://mirrors.yun-idc.com/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/os/${CENTOS_IMAGE_ARCH}/Packages/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
else
|
||||
download http://rpmfind.net/linux/${CENTOS_IMAGE_TYPE,,}/${CENTOS_IMAGE_VERSION}/os/${CENTOS_IMAGE_ARCH}/Packages/$f $f || exit $?
|
||||
fi
|
||||
done
|
||||
|
||||
centos_ppa_repo_rsyslog_packages="
|
||||
@ -231,7 +235,11 @@ liblogging-1.0.4-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CEN
|
||||
rsyslog-7.6.3-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_IMAGE_ARCH}.rpm"
|
||||
|
||||
for f in $centos_ppa_repo_rsyslog_packages; do
|
||||
download http://rpms.adiscon.com/v7-stable/epel-${CENTOS_IMAGE_VERSION_MAJOR}/${CENTOS_IMAGE_ARCH}/RPMS/$f $f || exit $?
|
||||
if [ "$REGION" == "asia" ]; then
|
||||
download http://mirrors.yun-idc.com/epel/${CENTOS_IMAGE_VERSION_MAJOR}/${CENTOS_IMAGE_ARCH}/$f $f copy /var/lib/cobbler/repo_mirror/centos_ppa_repo/ || exit $?
|
||||
else
|
||||
download http://rpms.adiscon.com/v7-stable/epel-${CENTOS_IMAGE_VERSION_MAJOR}/${CENTOS_IMAGE_ARCH}/RPMS/$f $f || exit $?
|
||||
fi
|
||||
done
|
||||
|
||||
download $CHEF_CLIENT `basename $CHEF_CLIENT` || exit $?
|
||||
@ -242,8 +250,13 @@ download $UBUNTU_CHEF_CLIENT `basename $UBUNTU_CHEF_CLIENT` || exit $?
|
||||
download $CHEF_SRV chef-server || exit $?
|
||||
|
||||
# download os images
|
||||
download "$CENTOS_IMAGE_SOURCE" ${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso || exit $?
|
||||
download "$UBUNTU_IMAGE_SOURCE" ${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso || exit $?
|
||||
if [ "$REGION" == "asia" ]; then
|
||||
download "$CENTOS_IMAGE_SOURCE_ASIA" ${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso || exit $?
|
||||
download "$UBUNTU_IMAGE_SOURCE_ASIA" ${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso || exit $?
|
||||
else
|
||||
download "$CENTOS_IMAGE_SOURCE" ${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso || exit $?
|
||||
download "$UBUNTU_IMAGE_SOURCE" ${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso || exit $?
|
||||
fi
|
||||
|
||||
# download local repo
|
||||
download -f https://s3-us-west-1.amazonaws.com/compass-local-repo/local_repo.tar.gz local_repo.tar.gz || exit $?
|
||||
|
@ -10,5 +10,6 @@ NEXTSERVER=\${NEXTSERVER:-$NEXTSERVER}
|
||||
IP_START=\${IP_START:-$IP_START}
|
||||
IP_END=\${IP_END:-$IP_END}
|
||||
LOCAL_REPO=\${LOCAL_REPO:-$LOCAL_REPO}
|
||||
REGION=\$(REGION:-$REGION}
|
||||
EOF
|
||||
chmod ugo+x $SCRIPT_DIR/env.conf
|
||||
|
Loading…
x
Reference in New Issue
Block a user