Refactor teleport configuration logic in entrypoint.sh to improve readability and maintainability
Build and Push Docker Images / build-and-push (push) Successful in 19s
Build and Push Docker Images / build-and-push (push) Successful in 19s
This commit is contained in:
@@ -132,9 +132,6 @@ if [ -n "$TELEPORT_VERSION" ] && [ -n "$TELEPORT_URL" ] && [ -n "$TELEPORT_TOKEN
|
||||
if [ ! -f /etc/teleport.yaml ]; then
|
||||
teleport configure --roles=node --token="$TELEPORT_TOKEN" --proxy="$TELEPORT_URL" --no-acme -o file
|
||||
echo "Created teleport configuration file"
|
||||
else
|
||||
echo "Teleport configuration file already exists, skipping configuration creation"
|
||||
fi
|
||||
|
||||
# Get the hostname of the machine
|
||||
HOSTNAME=$(hostname)
|
||||
@@ -143,6 +140,9 @@ if [ -n "$TELEPORT_VERSION" ] && [ -n "$TELEPORT_URL" ] && [ -n "$TELEPORT_TOKEN
|
||||
sed -i "s/^ nodename:.*/ nodename: $HOSTNAME/" /etc/teleport.yaml
|
||||
|
||||
add_teleport_labels
|
||||
else
|
||||
echo "Teleport configuration file already exists, skipping configuration creation"
|
||||
fi
|
||||
|
||||
# Start Teleport in the background
|
||||
echo "Starting Teleport service..."
|
||||
|
||||
Reference in New Issue
Block a user