osd: update lockbox key rotation for encrypted OSDs

Update `lockbox.keyring` rotation for encrypted OSDs to ensure the key
is not lost if the init container fails but continues assuming
(reasonably) that the key is likely still relevant.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
(cherry picked from commit 931006fb91)
This commit is contained in:
Blaine Gardner authored and Mergify committed 2026-02-26 15:41:44 +00:00
1 parent 45c7021219
commit 5002f78e2d
1 file changed
+4 -1
+4 -1
View File
@@ -120,9 +120,12 @@ if [ "$ENCRYPTED" == "true" ] ; then
if ! ceph --name client.admin auth get-or-create "$LOCKBOX_USER" \
mon 'allow command "config-key get" with key="dm-crypt/osd/'$OSD_UUID'/luks"' \
--keyring /etc/ceph/admin-keyring-store/keyring > "$LOCKBOX_KEYRING_FILE"; then
--keyring /etc/ceph/admin-keyring-store/keyring > /tmp/lockbox.keyring; then
echo "failed to get latest cephx lockbox key for OSD. continuing OSD startup using on-disk key" >/dev/stderr
# allowing OSD to attempt to start could avoid full OSD outage due to mon/system issues
else
echo "got latest cephx lockbox key for OSD successfully. updating on-disk key" >/dev/stderr
mv /tmp/lockbox.keyring "$LOCKBOX_KEYRING_FILE"
fi
fi