Skip to content

chore(examples): Add login_before_ready and startup_script_timeout #5880

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

Merged
merged 13 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use <<-EOT (vs <<EOT) to eliminate whitespace in front
  • Loading branch information
mafredri committed Jan 26, 2023
commit 22caabbc359f996b5bfcd9e3133dfcf4ea965d5c
2 changes: 1 addition & 1 deletion examples/templates/aws-ecs-container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ resource "coder_agent" "coder" {

delay_login_until_ready = true
startup_script_timeout = 180
startup_script = <<EOT
startup_script = <<-EOT
set -e

# install and start code-server
Expand Down
6 changes: 3 additions & 3 deletions examples/templates/aws-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resource "coder_agent" "main" {

delay_login_until_ready = true
startup_script_timeout = 180
startup_script = <<EOT
startup_script = <<-EOT
set -e

# install and start code-server
Expand Down Expand Up @@ -109,7 +109,7 @@ locals {
# User data is used to stop/start AWS instances. See:
# https://github.com/hashicorp/terraform-provider-aws/issues/22

user_data_start = <<EOT
user_data_start = <<-EOT
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0

Expand Down Expand Up @@ -139,7 +139,7 @@ sudo -u ${local.linux_user} sh -c '${coder_agent.main.init_script}'
--//--
EOT

user_data_end = <<EOT
user_data_end = <<-EOT
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0

Expand Down
4 changes: 2 additions & 2 deletions examples/templates/aws-windows/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ locals {
# User data is used to stop/start AWS instances. See:
# https://github.com/hashicorp/terraform-provider-aws/issues/22

user_data_start = <<EOT
user_data_start = <<-EOT
<powershell>
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
${coder_agent.main.init_script}
</powershell>
<persist>true</persist>
EOT

user_data_end = <<EOT
user_data_end = <<-EOT
<powershell>
shutdown /s
</powershell>
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker-code-server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "coder_agent" "main" {

delay_login_until_ready = true
startup_script_timeout = 180
startup_script = <<EOT
startup_script = <<-EOT
set -e
code-server --auth none >/tmp/code-server.log 2>&1 &
EOT
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker-image-builds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resource "coder_agent" "main" {

delay_login_until_ready = true
startup_script_timeout = 180
startup_script = <<EOT
startup_script = <<-EOT
set -e

# install and start code-server
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker-with-dotfiles/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "coder_agent" "main" {
delay_login_until_ready = true
startup_script_timeout = 180
env = { "DOTFILES_URI" = var.dotfiles_uri != "" ? var.dotfiles_uri : null }
startup_script = <<EOT
startup_script = <<-EOT
set -e
if [ -n "$DOTFILES_URI" ]; then
echo "Installing dotfiles from $DOTFILES_URI"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "coder_agent" "main" {

delay_login_until_ready = true
startup_script_timeout = 180
startup_script = <<EOT
startup_script = <<-EOT
set -e

# install and start code-server
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/gcp-linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ resource "coder_agent" "main" {

delay_login_until_ready = true
startup_script_timeout = 180
startup_script = <<EOT
startup_script = <<-EOT
set -e

# install and start code-server
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/gcp-vm-container/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "coder_agent" "main" {

delay_login_until_ready = true
startup_script_timeout = 180
startup_script = <<EOT
startup_script = <<-EOT
set -e

# install and start code-server
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ data "coder_workspace" "me" {}
resource "coder_agent" "main" {
os = "linux"
arch = "amd64"
startup_script = <<EOT
startup_script = <<-EOT
#!/bin/bash

# home folder can be empty, so copying default bash settings
Expand Down