kolla-ansible/ansible/roles/keystone/templates/fernet-node-sync.sh.j2
Michal Nasiadka 793a37e2ff Fix fernet bootstrap and key distribution - follow up
As per post-merge comments in [0] - following up.

[0]: https://review.opendev.org/#/c/698710

Change-Id: I92b3de7fb792f1fffe298ffaf6bbafab8e640742
2020-08-24 10:43:47 +01:00

20 lines
512 B
Django/Jinja

#!/bin/bash
set -o errexit
set -o pipefail
# Ensure tokens are populated, check for 0 key which should always exist
n=0
while [ ! -f /etc/keystone/fernet-keys/0 ]; do
if [ $n -lt 10 ]; then
n=$(( n + 1 ))
echo "ERROR: Fernet tokens have not been populated, rechecking in 1 minute"
echo "DEBUG: /etc/keystone/fernet-keys contents:"
ls -l /etc/keystone/fernet-keys/
sleep 60
else
echo "CRITICAL: Waited for 10 minutes - failing"
exit 1
fi
done