feat: install Terraform
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter 2023-06-15 18:35:29 +02:00
parent 093aaf328d
commit 94741b563d
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
2 changed files with 23 additions and 0 deletions

View file

@ -91,6 +91,10 @@ runcmd:
- ln -sf /usr/lib/systemd/system/podman.socket /home/${username}/.config/systemd/user/sockets.target.wants/ - ln -sf /usr/lib/systemd/system/podman.socket /home/${username}/.config/systemd/user/sockets.target.wants/
- sudo -u ${username} DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" systemctl --user start podman - sudo -u ${username} DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" systemctl --user start podman
%{ endif ~} %{ endif ~}
%{ if install_terraform_setup ~}
- dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
- dnf -y install terraform
%{ endif ~}
%{ if code_server_setup ~} %{ if code_server_setup ~}
- dnf install -y $(curl -sL https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.assets[].browser_download_url' | grep "amd64.rpm") - dnf install -y $(curl -sL https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.assets[].browser_download_url' | grep "amd64.rpm")
- systemctl enable --now code-server@${username} - systemctl enable --now code-server@${username}

View file

@ -227,6 +227,24 @@ data "coder_parameter" "install_podman" {
} }
} }
data "coder_parameter" "install_terraform" {
name = "install_terraform"
description = "Should Terraform be installed?"
default = "true"
type = "string"
mutable = true
option {
name = "Install"
value = "true"
}
option {
name = "Don't install"
value = "false"
}
}
data "coder_workspace" "me" { data "coder_workspace" "me" {
} }
@ -273,6 +291,7 @@ resource "hcloud_server" "root" {
install_go_setup = data.coder_parameter.install_go.value install_go_setup = data.coder_parameter.install_go.value
install_dotnet_setup = data.coder_parameter.install_dotnet.value install_dotnet_setup = data.coder_parameter.install_dotnet.value
install_podman_setup = data.coder_parameter.install_podman.value install_podman_setup = data.coder_parameter.install_podman.value
install_terraform_setup = data.coder_parameter.install_terraform.value
}) })
dynamic "network" { dynamic "network" {