From 45b60f831b8a0851f82ba4cf1ba3e06a210736f5 Mon Sep 17 00:00:00 2001 From: lens0021 Date: Sat, 2 Mar 2024 01:35:31 +0900 Subject: [PATCH] Print ACL token first --- nomad-acl-bootstrap | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nomad-acl-bootstrap b/nomad-acl-bootstrap index 51cde34..a3c8852 100755 --- a/nomad-acl-bootstrap +++ b/nomad-acl-bootstrap @@ -6,6 +6,10 @@ until nomad acl policy list > /dev/null; do sleep 1; done; NOMAD_TOKEN="$(nomad acl bootstrap | tail -n +2 | head -n 1 | awk '{print $4}')" + +# Print the token to stdout +echo "Nomad ACL Secret ID = $NOMAD_TOKEN" + export NOMAD_TOKEN=$NOMAD_TOKEN # Write NOMAD_TOKEN as a local file @@ -13,6 +17,3 @@ echo "$NOMAD_TOKEN" >> "/etc/nomad.d/token" # .bashrc: Add a step to read the token from the local file cat <<< 'export NOMAD_TOKEN=$(sudo cat /etc/nomad.d/token)' >> "$HOME/.bashrc" - -# Print the token to stdout -echo "Nomad ACL Secret ID = $NOMAD_TOKEN"