Use ${CEPH_DATA_DIR} everywhere

The CEPH_DATA_DIR variable holds the location of Ceph drives and
objects.  It defaults to '/var/lib/ceph'.

Replace hardcoded occurrences of '/var/lib/ceph' with
'${CEPH_DATA_DIR}'.

Change-Id: I2570e37f9135d853854600acfbfff3b768e4f0e3
This commit is contained in:
Tom Barron 2016-05-28 06:15:32 -04:00
parent 5e83890342
commit 5943d57eb4
1 changed files with 5 additions and 5 deletions

View File

@ -255,11 +255,11 @@ function configure_ceph {
${CEPH_DATA_DIR}/{bootstrap-mds,bootstrap-osd,mds,mon,osd,tmp,radosgw}
# create ceph monitor initial key and directory
sudo ceph-authtool /var/lib/ceph/tmp/keyring.mon.$(hostname) \
sudo ceph-authtool ${CEPH_DATA_DIR}/tmp/keyring.mon.$(hostname) \
--create-keyring --name=mon. --add-key=$(ceph-authtool \
--gen-print-key) --cap mon 'allow *'
sudo mkdir -p /var/lib/ceph/mon/ceph-$(hostname)
sudo mkdir -p ${CEPH_DATA_DIR}/mon/ceph-$(hostname)
# create a default ceph configuration file
cat <<EOF | sudo tee ${CEPH_CONF_FILE}>/dev/null
@ -278,10 +278,10 @@ EOF
# bootstrap the ceph monitor
sudo ceph-mon -c ${CEPH_CONF_FILE} --mkfs -i $(hostname) \
--keyring /var/lib/ceph/tmp/keyring.mon.$(hostname)
--keyring ${CEPH_DATA_DIR}/tmp/keyring.mon.$(hostname)
if is_ubuntu; then
sudo touch /var/lib/ceph/mon/ceph-$(hostname)/upstart
sudo touch ${CEPH_DATA_DIR}/mon/ceph-$(hostname)/upstart
# Do a Ceph version check. If version >= Infernalis, then make sure that
# the user "ceph" is the owner of files within the ${CEPH_DATA_DIR}.
# Check CLI version instead of mon daemon version as the mon daemon
@ -291,7 +291,7 @@ EOF
fi
sudo initctl emit ceph-mon id=$(hostname)
else
sudo touch /var/lib/ceph/mon/ceph-$(hostname)/sysvinit
sudo touch ${CEPH_DATA_DIR}/mon/ceph-$(hostname)/sysvinit
sudo service ceph start mon.$(hostname)
fi