Skip to content

Commit

Permalink
Change to handle cert sync logic in AMIs when running in all-in-one m…
Browse files Browse the repository at this point in the history
…ode (#5452) (#5526)
  • Loading branch information
webvictim authored Feb 10, 2021
1 parent 43fa7e4 commit d15ab12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/aws/files/bin/teleport-check-cert
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ if [ $? -eq 0 ]; then
echo "Certificates are equal, nothing to do"
else
echo "Certificates are different, going to update and restart proxy"
su teleport -c "aws s3 sync --exact-timestamps s3://${TELEPORT_S3_BUCKET}/live/${TELEPORT_DOMAIN_NAME} /var/lib/teleport"
SYNC_COMMAND="aws s3 sync --exact-timestamps s3://${TELEPORT_S3_BUCKET}/live/${TELEPORT_DOMAIN_NAME} /var/lib/teleport"
# handle proxy role
if [ -f /etc/teleport.d/role.proxy ]; then
su teleport -c "${SYNC_COMMAND}"
systemctl reload teleport-proxy.service
else
${SYNC_COMMAND}
systemctl reload teleport.service
fi
fi

0 comments on commit d15ab12

Please sign in to comment.