entrypoint: Store bootstrap token in variable

Following the mirroring setup there used to be a file named 'token'
holding the bootstrap token left out in sources. We could instead
provide the token via standard output and display it for any further
debugging purpose.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
This commit is contained in:
Anoop C S 2022-07-08 17:14:59 +05:30 committed by mergify[bot]
parent 0b06ef208d
commit 6dad78e5af
1 changed files with 3 additions and 2 deletions

View File

@ -169,8 +169,9 @@ setup_mirroring() {
rbd -c $CONF_B pool init
rbd -c $CONF_A mirror pool enable rbd image
rbd -c $CONF_B mirror pool enable rbd image
rbd -c $CONF_A mirror pool peer bootstrap create --site-name ceph_a rbd > token
rbd -c $CONF_B mirror pool peer bootstrap import --site-name ceph_b rbd token
token=$(rbd -c $CONF_A mirror pool peer bootstrap create --site-name ceph_a rbd)
echo "bootstrap token: ${token}"
echo ${token} | rbd -c $CONF_B mirror pool peer bootstrap import --site-name ceph_b rbd -
echo "enabled" > "${MIRROR_STATE}"
rbd -c $CONF_A rm mirror_test 2>/dev/null || true