diff --git a/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_slurm_database_password.sh.erb b/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_slurm_database_password.sh.erb index b0f2148dd9..30af40918d 100644 --- a/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_slurm_database_password.sh.erb +++ b/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_slurm_database_password.sh.erb @@ -30,6 +30,11 @@ fi echo "Reading password from AWS Secrets Manager: ${SECRET_ARN}" password_from_secrets_manager=$(aws secretsmanager get-secret-value --secret-id ${SECRET_ARN} --region ${REGION} --query 'SecretString' --output text) +if [[ "${password_from_secrets_manager}" =~ '#' ]]; then + echo "You cannot use the # character in the database password as Slurm does not support it with $SLURMDBD_PROPERTY configuration paramter in $SLURMDBD_CONFIG_FILE. Please refer to the official SchedMD documentation for more details." + exit 1 +fi + [ "${password_from_dbd_config}" == "${password_from_secrets_manager}" ] && echo "Password match, skipping update" && exit 0 echo "Writing AWS Secrets Manager password to ${SLURMDBD_CONFIG_FILE}"