Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ha-autoscale-cluster: Source unit file environment variables from /etc/default/teleport #48040

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions assets/aws/files/system/teleport-proxy-acm.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Restart=always
RestartSec=5
RuntimeDirectory=teleport
EnvironmentFile=-/etc/default/teleport
# TODO(gus): REMOVE IN 17.0.0 - /etc/default/teleport should be used instead
EnvironmentFile=/etc/teleport.d/conf
ExecStartPre=/usr/local/bin/teleport-ssm-get-token
ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid
# systemd before 239 needs an absolute path
Expand Down
2 changes: 0 additions & 2 deletions assets/aws/files/system/teleport-proxy.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Restart=always
RestartSec=5
RuntimeDirectory=teleport
EnvironmentFile=-/etc/default/teleport
# TODO(gus): REMOVE IN 17.0.0 - /etc/default/teleport should be used instead
EnvironmentFile=/etc/teleport.d/conf
ExecStartPre=/usr/local/bin/teleport-ssm-get-token
ExecStartPre=/bin/aws s3 sync s3://${TELEPORT_S3_BUCKET}/live/${TELEPORT_DOMAIN_NAME} /var/lib/teleport
ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ TELEPORT_ENABLE_POSTGRES=${enable_postgres_listener}
USE_ACM=${use_acm}
USE_TLS_ROUTING=${use_tls_routing}
EOF
cat >>/etc/default/teleport <<EOF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is /etc/teleport.d/conf also necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that file is sourced all over the place.

I could theoretically rewrite all the places it's used to use /etc/default/teleport instead, but setting a lot of extra environment variables in the environment file Teleport itself sources might have unintended consequences. It'd also be a huge PR that would need a lot of testing.

At the moment there's a relatively clean split between "environment variables used by Teleport" and "environment variables used by the AMI/unit files".

EC2_REGION=${region}
TELEPORT_DOMAIN_NAME=${domain_name}
TELEPORT_S3_BUCKET=${s3_bucket}
EOF
Loading