Use official bionic repos for manila

The shaman ceph and ganesha repos for ubuntu bionic are less
stable than those available with the bionic distro itself so
use the latter.

Also refactor the ceph/ganesha repo configuration so that it
is easier to read and maintain, and since bionic does not ship
with knfs installed make the service stop/disable for these
services robust in that case.

Change-Id: If00cc82cfb076c75a11738dcaca372b0cc7a1848
This commit is contained in:
Tom Barron
2018-12-22 07:28:54 -05:00
parent 5b5fd0dfca
commit c669989cd8

View File

@@ -718,8 +718,8 @@ function configure_ceph_manila {
if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
configure_nfs_ganesha configure_nfs_ganesha
# NFS-Ganesha server cannot run alongwith with other kernel NFS server. # NFS-Ganesha server cannot run alongwith with other kernel NFS server.
sudo systemctl stop nfs-server sudo systemctl stop nfs-server || true
sudo systemctl disable nfs-server sudo systemctl disable nfs-server || true
sudo systemctl enable nfs-ganesha sudo systemctl enable nfs-ganesha
sudo systemctl start nfs-ganesha || ( sudo systemctl start nfs-ganesha || (
echo "Ganesha didn't start. Let's debug..." >&2 echo "Ganesha didn't start. Let's debug..." >&2
@@ -913,6 +913,52 @@ function configure_repo_nfsganesha {
fi fi
} }
function setup_packages_for_manila_on_ubuntu {
if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
if ! [[ $os_CODENAME =~ (xenial|bionic) ]]; then
die $LINENO "Need Ubuntu xenial or newer to setup Manila with CephFS NFS-Ganesha driver"
fi
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2 nfs-ganesha nfs-ganesha-ceph"
# bionic repos are all there already
if [[ $os_CODENAME =~ xenial ]]; then
# The 'apt' package manager needs the following package to access
# HTTPS enabled repositories such as the Ceph repos hosted by the
# shaman/chacra system.
install_package apt-transport-https
configure_repo_ceph "apt" "luminous" "ubuntu" "$os_CODENAME"
configure_repo_nfsganesha "apt" "ceph_luminous" "ubuntu" "$os_CODENAME"
fi
else # Native driver
if ! [[ $os_CODENAME =~ (bionic|xenial|trusty) ]]; then
die $LINENO "Need Ubuntu trusty or newer to setup Manila with CephFS native driver"
fi
if [[ $os_CODENAME =~ (xenial|trusty) ]]; then
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs1"
# The 'apt' package manager needs the following package to access
# HTTPS enabled repositories such as the Ceph repos hosted by the
# shaman/chacra system.
install_package apt-transport-https
configure_repo_ceph "apt" "jewel" "ubuntu" "$os_CODENAME"
else # bionic repos are already there in the distro
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2"
fi
fi
}
function setup_packages_for_manila_on_fedora_family {
if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
if [ $DISTRO_TYPE == 'centos' ]; then
configure_repo_ceph "yum" "luminous" "${DISTRO_TYPE}" "${RELEASE}"
configure_repo_nfsganesha "yum" "ceph_luminous" "${DISTRO_TYPE}" "${RELEASE}"
fi
CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph"
else
if [ $DISTRO_TYPE == 'centos' ]; then
configure_repo_ceph "yum" "jewel" "${DISTRO_TYPE}" "${RELEASE}"
fi
fi
}
function install_ceph { function install_ceph {
if is_ubuntu; then if is_ubuntu; then
CEPH_PACKAGES="ceph libnss3-tools" CEPH_PACKAGES="ceph libnss3-tools"
@@ -922,26 +968,7 @@ function install_ceph {
install_package software-properties-common install_package software-properties-common
if is_ceph_enabled_for_service manila; then if is_ceph_enabled_for_service manila; then
# The 'apt' package manager needs the following package to access setup_packages_for_manila_on_ubuntu
# HTTPS enabled repositories such as the Ceph repos hosted by the
# shaman/chacra system.
install_package apt-transport-https
if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
if ! [[ $os_CODENAME =~ (xenial|bionic) ]]; then
die $LINENO "Need Ubuntu xenial or newer to setup Manila with CephFS NFS-Ganesha driver"
fi
configure_repo_ceph "apt" "luminous" "ubuntu" "$os_CODENAME"
configure_repo_nfsganesha "apt" "ceph_luminous" "ubuntu" "$os_CODENAME"
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2 nfs-ganesha nfs-ganesha-ceph"
else
if ! [[ $os_CODENAME =~ (bionic|xenial|trusty) ]]; then
die $LINENO "Need Ubuntu trusty or newer to setup Manila with CephFS native driver"
fi
configure_repo_ceph "apt" "jewel" "ubuntu" "$os_CODENAME"
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs1"
fi
elif [[ $os_CODENAME =~ bionic ]]; then elif [[ $os_CODENAME =~ bionic ]]; then
# Ceph Luminous is available in Ubuntu bionic natively, no need to set up # Ceph Luminous is available in Ubuntu bionic natively, no need to set up
# any additional repos # any additional repos
@@ -989,22 +1016,10 @@ function install_ceph {
CEPH_PACKAGES="ceph" CEPH_PACKAGES="ceph"
if is_ceph_enabled_for_service manila; then if is_ceph_enabled_for_service manila; then
if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then setup_packages_for_manila_on_fedora_family
if [ $DISTRO_TYPE == 'centos' ]; then elif [ $DISTRO_TYPE == 'centos' ]; then
configure_repo_ceph "yum" "luminous" "${DISTRO_TYPE}" "${RELEASE}"
configure_repo_nfsganesha "yum" "ceph_luminous" "${DISTRO_TYPE}" "${RELEASE}"
fi
CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph"
else
if [ $DISTRO_TYPE == 'centos' ]; then
configure_repo_ceph "yum" "jewel" "${DISTRO_TYPE}" "${RELEASE}" configure_repo_ceph "yum" "jewel" "${DISTRO_TYPE}" "${RELEASE}"
fi fi
fi
else
if [ $DISTRO_TYPE == 'centos' ]; then
configure_repo_ceph "yum" "jewel" "${DISTRO_TYPE}" "${RELEASE}"
fi
fi
if [ "$ENABLE_CEPH_RGW" = "True" ]; then if [ "$ENABLE_CEPH_RGW" = "True" ]; then
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-radosgw" CEPH_PACKAGES="${CEPH_PACKAGES} ceph-radosgw"