This commit is contained in:
@@ -132,20 +132,20 @@ if [ -n "$TELEPORT_VERSION" ] && [ -n "$TELEPORT_URL" ] && [ -n "$TELEPORT_TOKEN
|
|||||||
if [ ! -f /etc/teleport.yaml ]; then
|
if [ ! -f /etc/teleport.yaml ]; then
|
||||||
teleport configure --roles=node --token="$TELEPORT_TOKEN" --proxy="$TELEPORT_URL" --no-acme -o file
|
teleport configure --roles=node --token="$TELEPORT_TOKEN" --proxy="$TELEPORT_URL" --no-acme -o file
|
||||||
echo "Created teleport configuration file"
|
echo "Created teleport configuration file"
|
||||||
|
else
|
||||||
|
echo "Teleport configuration file already exists, skipping configuration creation"
|
||||||
|
fi
|
||||||
|
|
||||||
# Get the hostname of the machine
|
# Get the hostname of the machine
|
||||||
HOSTNAME=$(hostname)
|
HOSTNAME=$(hostname)
|
||||||
|
|
||||||
# Update nodename in teleport config
|
# Update nodename in teleport config
|
||||||
sed -i "s/^ nodename:.*/ nodename: $HOSTNAME/" /etc/teleport.yaml
|
sed -i "s/^ nodename:.*/ nodename: $HOSTNAME/" /etc/teleport.yaml
|
||||||
|
|
||||||
add_teleport_labels
|
add_teleport_labels
|
||||||
else
|
|
||||||
echo "Teleport configuration file already exists, skipping configuration creation"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start Teleport in the background
|
# Start Teleport in the background
|
||||||
echo "Starting Teleport service..."
|
echo "Starting Teleport service..."
|
||||||
|
cat /etc/teleport.yaml
|
||||||
nohup teleport start &
|
nohup teleport start &
|
||||||
else
|
else
|
||||||
echo "Skipping Teleport setup - credentials not provided"
|
echo "Skipping Teleport setup - credentials not provided"
|
||||||
|
|||||||
Reference in New Issue
Block a user