diff --git a/dogfood/main.tf b/dogfood/main.tf index e98d422554..46862d47eb 100644 --- a/dogfood/main.tf +++ b/dogfood/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.0" + version = "0.6.10" } docker = { source = "kreuzwerker/docker" @@ -58,11 +58,13 @@ provider "coder" {} data "coder_workspace" "me" {} resource "coder_agent" "dev" { - arch = "amd64" - os = "linux" - startup_script = <&1 | tee -a ~/.personalize.log fi if [ -x ~/personalize ]; then - ~/personalize | tee -a ~/.personalize.log + ~/personalize 2>&1 | tee -a ~/.personalize.log elif [ -f ~/personalize ]; then echo "~/personalize is not executable, skipping..." | tee -a ~/.personalize.log fi - EOF + EOT } resource "coder_app" "code-server" { diff --git a/examples/templates/aws-ecs-container/main.tf b/examples/templates/aws-ecs-container/main.tf index 2f07f965e5..2ae6b833d4 100644 --- a/examples/templates/aws-ecs-container/main.tf +++ b/examples/templates/aws-ecs-container/main.tf @@ -6,7 +6,7 @@ terraform { } coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } } } @@ -92,15 +92,19 @@ resource "aws_ecs_service" "workspace" { data "coder_workspace" "me" {} resource "coder_agent" "coder" { - arch = "amd64" - auth = "token" - os = "linux" - dir = "/home/coder" - startup_script = </tmp/code-server.log 2>&1 & EOT } diff --git a/examples/templates/aws-linux/main.tf b/examples/templates/aws-linux/main.tf index c4d70d3b6b..4a70707f6c 100644 --- a/examples/templates/aws-linux/main.tf +++ b/examples/templates/aws-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } } } @@ -73,15 +73,18 @@ data "aws_ami" "ubuntu" { } resource "coder_agent" "main" { - arch = "amd64" - auth = "aws-instance-identity" - os = "linux" - startup_script = </tmp/code-server.log 2>&1 & EOT } diff --git a/examples/templates/aws-windows/main.tf b/examples/templates/aws-windows/main.tf index 062b07d822..035a915f57 100644 --- a/examples/templates/aws-windows/main.tf +++ b/examples/templates/aws-windows/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } } } @@ -73,6 +73,8 @@ resource "coder_agent" "main" { arch = "amd64" auth = "aws-instance-identity" os = "windows" + + login_before_ready = false } locals { diff --git a/examples/templates/azure-linux/main.tf b/examples/templates/azure-linux/main.tf index e388ff1783..e0237254bd 100644 --- a/examples/templates/azure-linux/main.tf +++ b/examples/templates/azure-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } azurerm = { source = "hashicorp/azurerm" @@ -83,6 +83,8 @@ resource "coder_agent" "main" { arch = "amd64" os = "linux" auth = "azure-instance-identity" + + login_before_ready = false } locals { diff --git a/examples/templates/do-linux/main.tf b/examples/templates/do-linux/main.tf index cc345411be..f8742bfb72 100644 --- a/examples/templates/do-linux/main.tf +++ b/examples/templates/do-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } digitalocean = { source = "digitalocean/digitalocean" @@ -96,6 +96,8 @@ data "coder_workspace" "me" {} resource "coder_agent" "main" { os = "linux" arch = "amd64" + + login_before_ready = false } resource "digitalocean_volume" "home_volume" { diff --git a/examples/templates/docker-code-server/main.tf b/examples/templates/docker-code-server/main.tf index 57f4b0f023..706de7da1c 100644 --- a/examples/templates/docker-code-server/main.tf +++ b/examples/templates/docker-code-server/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } docker = { source = "kreuzwerker/docker" @@ -21,9 +21,15 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script = "code-server --auth none" + arch = data.coder_provisioner.me.arch + os = "linux" + + login_before_ready = false + startup_script_timeout = 180 + startup_script = <<-EOT + set -e + code-server --auth none >/tmp/code-server.log 2>&1 & + EOT # These environment variables allow you to make Git commits right away after creating a # workspace. Note that they take precedence over configuration defined in ~/.gitconfig! diff --git a/examples/templates/docker-image-builds/main.tf b/examples/templates/docker-image-builds/main.tf index 22eddf9007..6668867053 100644 --- a/examples/templates/docker-image-builds/main.tf +++ b/examples/templates/docker-image-builds/main.tf @@ -3,7 +3,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } docker = { source = "kreuzwerker/docker" @@ -22,14 +22,17 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script = </tmp/code-server.log 2>&1 & EOT } diff --git a/examples/templates/docker-with-dotfiles/main.tf b/examples/templates/docker-with-dotfiles/main.tf index 795bcaf90b..6b2c956d0e 100644 --- a/examples/templates/docker-with-dotfiles/main.tf +++ b/examples/templates/docker-with-dotfiles/main.tf @@ -9,7 +9,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } docker = { source = "kreuzwerker/docker" @@ -41,9 +41,19 @@ variable "dotfiles_uri" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script = var.dotfiles_uri != "" ? "coder dotfiles -y ${var.dotfiles_uri}" : null + arch = data.coder_provisioner.me.arch + os = "linux" + + login_before_ready = false + startup_script_timeout = 180 + env = { "DOTFILES_URI" = var.dotfiles_uri != "" ? var.dotfiles_uri : null } + startup_script = <<-EOT + set -e + if [ -n "$DOTFILES_URI" ]; then + echo "Installing dotfiles from $DOTFILES_URI" + coder dotfiles -y "$DOTFILES_URI" + fi + EOT } resource "docker_volume" "home_volume" { diff --git a/examples/templates/docker/build/Dockerfile b/examples/templates/docker/build/Dockerfile index 29d3bf7cf0..a443b5d071 100644 --- a/examples/templates/docker/build/Dockerfile +++ b/examples/templates/docker/build/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* ARG USER=coder -RUN useradd --groups sudo --no-create-home ${USER} \ +RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \ && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \ && chmod 0440 /etc/sudoers.d/${USER} USER ${USER} diff --git a/examples/templates/docker/main.tf b/examples/templates/docker/main.tf index 7e29d565c5..89bf7215e2 100644 --- a/examples/templates/docker/main.tf +++ b/examples/templates/docker/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } docker = { source = "kreuzwerker/docker" @@ -25,14 +25,18 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - arch = data.coder_provisioner.me.arch - os = "linux" - startup_script = </tmp/code-server.log 2>&1 & + EOT # These environment variables allow you to make Git commits right away after creating a # workspace. Note that they take precedence over configuration defined in ~/.gitconfig! diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index fe9cd00174..26ed3ab365 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } google = { source = "hashicorp/google" @@ -46,15 +46,18 @@ resource "google_compute_disk" "root" { } resource "coder_agent" "main" { - auth = "google-instance-identity" - arch = "amd64" - os = "linux" - startup_script = </tmp/code-server.log 2>&1 & EOT } diff --git a/examples/templates/gcp-vm-container/main.tf b/examples/templates/gcp-vm-container/main.tf index c8a4167c5a..92b5162195 100644 --- a/examples/templates/gcp-vm-container/main.tf +++ b/examples/templates/gcp-vm-container/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } google = { source = "hashicorp/google" @@ -36,15 +36,18 @@ data "coder_workspace" "me" { } resource "coder_agent" "main" { - auth = "google-instance-identity" - arch = "amd64" - os = "linux" - startup_script = </tmp/code-server.log 2>&1 & EOT } diff --git a/examples/templates/gcp-windows/main.tf b/examples/templates/gcp-windows/main.tf index 25d58fc920..bdc1b0b60c 100644 --- a/examples/templates/gcp-windows/main.tf +++ b/examples/templates/gcp-windows/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.6" + version = "0.6.10" } google = { source = "hashicorp/google" @@ -49,6 +49,8 @@ resource "coder_agent" "main" { auth = "google-instance-identity" arch = "amd64" os = "windows" + + login_before_ready = false } resource "google_compute_instance" "dev" { diff --git a/examples/templates/kubernetes/README.md b/examples/templates/kubernetes/README.md index f0725a58ff..edb0b26883 100644 --- a/examples/templates/kubernetes/README.md +++ b/examples/templates/kubernetes/README.md @@ -96,9 +96,8 @@ block of your workspace template: ```terraform resource "coder_agent" "main" { - startup_script = </tmp/code-server.log 2>&1 & EOT }