puppet: Move files out and back when mounting /srv.

Specifically, this affects /srv/zulip-aws-tools.
This commit is contained in:
Alex Vandiver 2021-05-18 23:37:18 +00:00 committed by Tim Abbott
parent 81644f110e
commit 116e41f1da
1 changed files with 5 additions and 0 deletions

View File

@ -13,7 +13,12 @@ fi
if ! mountpoint -q /srv; then
mkfs.xfs "$LOCALDISK"
# Move any existing files/directories out of the way
TMPDIR=$(mktemp -d)
mv /srv/* "$TMPDIR"
mount /srv
mv "$TMPDIR/"* /srv
rmdir "$TMPDIR"
fi
if [ ! -L /var/lib/postgresql ]; then