Skip to content

Commit

Permalink
Merge pull request #2068 from metal3-io-bot/cherry-pick-2063-to-relea…
Browse files Browse the repository at this point in the history
…se-0.6

🌱 use uuidgen to generate random username/password
  • Loading branch information
metal3-io-bot authored Nov 20, 2024
2 parents 77ad450 + d3c83b8 commit 32d298b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ mkdir -p "${IRONIC_AUTH_DIR}"
if [[ "${DEPLOY_BASIC_AUTH}" == "true" ]]; then
if [ -z "${IRONIC_USERNAME:-}" ]; then
if [ ! -f "${IRONIC_AUTH_DIR}ironic-username" ]; then
IRONIC_USERNAME="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)"
IRONIC_USERNAME="$(uuidgen)"
echo "$IRONIC_USERNAME" > "${IRONIC_AUTH_DIR}ironic-username"
else
IRONIC_USERNAME="$(cat "${IRONIC_AUTH_DIR}ironic-username")"
fi
fi
if [ -z "${IRONIC_PASSWORD:-}" ]; then
if [ ! -f "${IRONIC_AUTH_DIR}ironic-password" ]; then
IRONIC_PASSWORD="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)"
IRONIC_PASSWORD="$(uuidgen)"
echo "$IRONIC_PASSWORD" > "${IRONIC_AUTH_DIR}ironic-password"
else
IRONIC_PASSWORD="$(cat "${IRONIC_AUTH_DIR}ironic-password")"
Expand Down

0 comments on commit 32d298b

Please sign in to comment.