Format Terraform

pull/48/head
Kyle Carberry 2 years ago
parent 5cc5fdcfd5
commit 34700432ee

@ -17,7 +17,7 @@ variable "agent_id" {
variable "extensions" { variable "extensions" {
type = list(string) type = list(string)
description = "A list of extensions to install." description = "A list of extensions to install."
default = [ ] default = []
} }
variable "port" { variable "port" {
@ -55,12 +55,12 @@ resource "coder_script" "code-server" {
display_name = "code-server" display_name = "code-server"
icon = "/icon/code.svg" icon = "/icon/code.svg"
script = templatefile("${path.module}/run.sh", { script = templatefile("${path.module}/run.sh", {
EXTENSIONS: join(",", var.extensions), EXTENSIONS : join(",", var.extensions),
PORT: var.port, PORT : var.port,
LOG_PATH: var.log_path, LOG_PATH : var.log_path,
INSTALL_PREFIX: var.install_prefix, INSTALL_PREFIX : var.install_prefix,
// This is necessary otherwise the quotes are stripped! // This is necessary otherwise the quotes are stripped!
SETTINGS: replace(jsonencode(var.settings), "\"", "\\\""), SETTINGS : replace(jsonencode(var.settings), "\"", "\\\""),
}) })
run_on_start = true run_on_start = true
} }

@ -30,8 +30,8 @@ resource "coder_script" "git_clone" {
display_name = "Git Clone" display_name = "Git Clone"
icon = "/icons/git.svg" icon = "/icons/git.svg"
script = templatefile("${path.module}/run.sh", { script = templatefile("${path.module}/run.sh", {
CLONE_PATH: var.path != "" ? var.path : join("/", ["~", basename(var.url)]), CLONE_PATH : var.path != "" ? var.path : join("/", ["~", basename(var.url)]),
REPO_URL: var.url, REPO_URL : var.url,
}) })
run_on_start = true run_on_start = true
} }

@ -29,7 +29,7 @@ variable "log_path" {
resource "coder_script" "personalize" { resource "coder_script" "personalize" {
agent_id = var.agent_id agent_id = var.agent_id
script = templatefile("${path.module}/run.sh", { script = templatefile("${path.module}/run.sh", {
PERSONALIZE_PATH: var.path, PERSONALIZE_PATH : var.path,
}) })
display_name = "Personalize" display_name = "Personalize"
icon = "/emojis/1f58c.png" icon = "/emojis/1f58c.png"

Loading…
Cancel
Save