-
Notifications
You must be signed in to change notification settings - Fork 891
chore: update lima example to use --with-terraform arg #5655
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
Conversation
- mode: system | ||
script: | | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
command -v terraform >/dev/null 2>&1 && exit 0 | ||
DEBIAN_FRONTEND=noninteractive apt-get install -qqy unzip | ||
rm -fv /tmp/terraform.zip || true | ||
wget -qO /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.3.0/terraform_1.3.0_linux_$(dpkg --print-architecture).zip" | ||
unzip /tmp/terraform.zip -d /usr/local/bin/ | ||
chmod +x /usr/local/bin/terraform | ||
rm -fv /tmp/terraform.zip || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review: no longer required
examples/lima/coder.yaml
Outdated
# Install some dependencies | ||
apt-get install -qqy unzip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review: required for --with-terraform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe leave a comment in the code
# Wait for Terraform to be installed | ||
timeout 60s bash -c 'until /usr/local/bin/terraform version >/dev/null 2>&1; do sleep 1; done' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review: terraform path updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer required at all, right? It should be installed by the time install.sh
finishes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking here is that if terraform installation fails for some reason, it will be more obvious to the end-user.
Edit: thinking more about it, any errors with Terraform installation should show up in the cloud-init log and be surfaced by install.sh
, so this probably doesn't add much value.
message: | | ||
All Done! Your Coder instance is accessible at http://localhost:3000 | ||
|
||
Username: "[email protected]" | ||
Password: Run `LIMA_INSTANCE=coder lima cat /home/${USER}.linux/.config/coderv2/password` 🤫 | ||
Password: Run `LIMA_INSTANCE={{.Instance.Name}} lima cat /home/${USER}.linux/.config/coderv2/password` 🤫 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍🏻
# Wait for Terraform to be installed | ||
timeout 60s bash -c 'until /usr/local/bin/terraform version >/dev/null 2>&1; do sleep 1; done' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer required at all, right? It should be installed by the time install.sh
finishes.
examples/lima/coder.yaml
Outdated
# Install some dependencies | ||
apt-get install -qqy unzip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe leave a comment in the code
#5586 added the capability for
install.sh
to download and install Terraform automatically. Using this now in the example Lima specification.Also no longer hard-coding the instance name in favour of
{{.Instance.Name}}
in the output that gets emitted upon successful instance provisioning.