asdf-community / asdf-hashicorp Goto Github PK
View Code? Open in Web Editor NEWHashiCorp plugin for the asdf version manager
Home Page: https://github.com/asdf-vm/asdf
License: MIT License
HashiCorp plugin for the asdf version manager
Home Page: https://github.com/asdf-vm/asdf
License: MIT License
Hello, what do you think about managing versions and not only installing, such as rbenv, tfenv, nvm, etc?
Hello,
I was reading your install script and wasn't sure what these lines did:
# required environment variables
: "${ASDF_INSTALL_TYPE?}"
: "${ASDF_INSTALL_VERSION?}"
: "${ASDF_INSTALL_PATH?}"
Could you possibly tell me? Sorry to bug you like this :(
Hello,
I'm using asdf version v0.10.1 and trying to install terraform version 1.0.3, but I am getting the following error:
$ asdf install terraform 1.0.3
Downloading terraform version 1.0.3 from https://releases.hashicorp.com/terraform/1.0.3/terraform_1.0.3_linux_amd64.zip
Error: terraform version 1.0.3 not found
I've checked hashicorp and verified that that version/path exists.
I'm using WSL 2.0 on Ubuntu-10.04.
Please let me know what I can do to resolve here.
Thanks,
Russell
I appreciate that the plugin tries to determine the version to run based on the terraform code, but if it's not going to parse constraints that are valid to TF, that's no help.
It only displays the message when I don't have a "local" or "shell" version configured via asdf itself, but I do have one selected globally. And it's clearly not a "FATAL" condition, since it proceeds to run that version after printing the message out.
Would rather just get rid of the message.
We currently use tfenv for terraform versioning and other tools for other languages and I am trying to convince my team to switch to asdf but we have a ton of repos with a .terraform-version
file in them. So supporting that file format would ease or transition.
The file format is as follows:
latest:<regex>
I have a project that is still using 0.12.29, which isn't available in arm64
arch for darwin
:
$ asdf install terraform 0.12.29
Downloading terraform version 0.12.29 from https://releases.hashicorp.com/terraform/0.12.29/terraform_0.12.29_darwin_arm.zip
Error: terraform version 0.12.29 not found
I'm not sure if you want to special-case darwin_arm
to fall back to darwin_amd64
, but if not it would be nice to at least be able to manually set my arch via an environment variable so one can do something like ASDF_ARCH=amd64 asdf install terraform 0.12.29
to install the amd64 version.
Downloading terraform version 0.12.29 from https://releases.hashicorp.com/terraform/0.12.29/terraform_0.12.29_darwin_arm.zip
Error: terraform version 0.12.29 not found
Hashicorp hasn't released new silicon versions of terraform yet, but the amd64 versions work fine due to Rosetta.
asdf should download arm versions if they're available (currently not released for any stable version) and fall back on a Rosetta compatible amd64 version if there's no arm version available.
https://releases.hashicorp.com/ has been responding with a 405 status code for quite some time, maybe about 3 weeks or more. I'm from Russia, but through German VPN its the same.
asdf install terraform 1.1.7
Downloading terraform version 1.1.7 from https://releases.hashicorp.com/terraform/1.1.7/terraform_1.1.7_darwin_amd64.zip
Error: terraform version 1.1.7 not found
❯ http https://releases.hashicorp.com/terraform/1.1.7/terraform_1.1.7_darwin_amd64.zip
HTTP/1.1 405 Not allowed
Accept-Ranges: bytes
Connection: close
Content-Length: 427
Content-Type: text/html; charset=utf-8
Date: Mon, 04 Apr 2022 23:03:21 GMT
Retry-After: 0
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>405 Not allowed</title>
</head>
<body>
<h1>Error 405 Not allowed</h1>
<p>Not allowed</p>
<h3>Guru Mediation:</h3>
<p>Details: cache-bma1673-BMA 1649113401 3872867351</p>
<hr>
<p>Varnish cache server</p>
</body>
</html>
https://status.hashicorp.com/#past-incidents says there was an incident on April 1 with an artifact repository. But in fact, it hasn't been working for much longer and the problem remains.
Maybe there is an option to use some kind of mirror?
Line 117 in 3bc5829
Isn't the lower and upper part of install reversed?
local -r upper_toolname=$(echo "${toolname}" | tr '[:lower:]' '[:upper:]')
N/A
$ asdf list all vault
0.1.0
0.1.1
0.1.2
0.2.0
0.3.0
0.3.1
0.4.0
0.4.1
0.5.0
0.5.1
0.5.2
0.5.3
0.6.0
0.6.1
0.6.2
0.6.3
0.6.4
0.6.5
0.7.0
0.7.1
0.7.2
0.7.3
0.8.0-beta1
0.8.0-rc1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
0.9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.8
1.8.8+ent
1.8.8+ent
1.8.9+ent
1.8.9+ent
1.8.9
1.8.10
1.8.10+ent
1.8.10+ent
1.8.11+ent
1.8.11+ent
1.8.11
1.8.12+ent
1.8.12
1.8.12+ent
1.9.0-rc1+ent
1.9.0-rc1+ent
1.9.0-rc1
1.9.0
1.9.0+ent
1.9.0+ent
1.9.1+ent
1.9.1
1.9.1+ent
1.9.2+ent
1.9.2+ent
1.9.2
1.9.3+ent
1.9.3
1.9.3+ent
1.9.4+ent
1.9.4+ent
1.9.4
1.9.5+ent
1.9.5
1.9.5+ent
1.9.6+ent
1.9.6
1.9.6+ent
1.9.7
1.9.7+ent
1.9.7+ent
1.9.8+ent
1.9.8+ent
1.9.8
1.9.9
1.9.9+ent
1.9.9+ent
1.9.10+ent
1.9.10
1.9.10+ent
1.10.0-rc1+ent
1.10.0-rc1+ent
1.10.0-rc1
1.10.0+ent
1.10.0+ent
1.10.0
1.10.1+ent
1.10.1
1.10.1+ent
1.10.2+ent
1.10.2+ent
1.10.2
1.10.3+ent
1.10.3+ent
1.10.3
1.10.3+ent
1.10.3+ent
1.10.4+ent
1.10.4+ent
1.10.4+ent
1.10.4+ent
1.10.4
1.10.5
1.10.5+ent
1.10.5+ent
1.10.5+ent
1.10.5+ent
1.10.6+ent
1.10.6+ent
1.10.6+ent
1.10.6
1.10.6+ent
1.10.7+ent
1.10.7
1.10.7+ent
1.10.7+ent
1.10.7+ent
1.10.8+ent
1.10.8+ent
1.10.8+ent
1.10.8
1.10.8+ent
1.10.9+ent
1.10.9+ent
1.10.9
1.10.9+ent
1.10.9+ent
1.10.10+ent
1.10.10+ent
1.10.10+ent
1.10.10
1.10.10+ent
1.10.11+ent
1.10.11+ent
1.10.11
1.10.11+ent
1.10.11+ent
1.11.0-rc1+ent
1.11.0-rc1+ent
1.11.0-rc1+ent
1.11.0-rc1+ent
1.11.0-rc1
1.11.0+ent
1.11.0+ent
1.11.0
1.11.0+ent
1.11.0+ent
1.11.1+ent
1.11.1+ent
1.11.1
1.11.1+ent
1.11.1+ent
1.11.2+ent
1.11.2+ent
1.11.2
1.11.2+ent
1.11.2+ent
1.11.3+ent
1.11.3+ent
1.11.3+ent
1.11.3+ent
1.11.3
1.11.4
1.11.4+ent
1.11.4+ent
1.11.4+ent
1.11.4+ent
1.11.5+ent
1.11.5+ent
1.11.5+ent
1.11.5
1.11.5+ent
1.11.6
1.11.6+ent
1.11.6+ent
1.11.6+ent
1.11.6+ent
1.11.7+ent
1.11.7+ent
1.11.7+ent
1.11.7+ent
1.11.7
1.11.8+ent
1.11.8+ent
1.11.8
1.11.8+ent
1.11.8+ent
1.11.9+ent
1.11.9+ent
1.11.9+ent
1.11.9+ent
1.11.9
1.11.10
1.11.10+ent
1.11.10+ent
1.11.10+ent
1.11.10+ent
1.11.11
1.11.11+ent
1.11.11+ent
1.11.11+ent
1.11.11+ent
1.11.12+ent
1.11.12
1.11.12+ent
1.11.12+ent
1.11.12+ent
1.12.0-rc1+ent
1.12.0-rc1+ent
1.12.0-rc1+ent
1.12.0-rc1
1.12.0-rc1+ent
1.12.0
1.12.0+ent
1.12.0+ent
1.12.0+ent
1.12.0+ent
1.12.1+ent
1.12.1+ent
1.12.1+ent
1.12.1
1.12.1+ent
1.12.2
1.12.2+ent
1.12.2+ent
1.12.2+ent
1.12.2+ent
1.12.3+ent
1.12.3
1.12.3+ent
1.12.3+ent
1.12.3+ent
1.12.4+ent
1.12.4+ent
1.12.4+ent
1.12.4+ent
1.12.4
1.12.5+ent
1.12.5+ent
1.12.5+ent
1.12.5+ent
1.12.5
1.12.6+ent
1.12.6+ent
1.12.6+ent
1.12.6
1.12.6+ent
1.12.7+ent
1.12.7+ent
1.12.7
1.12.7+ent
1.12.7+ent
1.12.8+ent
1.12.8+ent
1.12.8
1.12.8+ent
1.12.8+ent
1.12.9+ent
1.12.9
1.12.9+ent
1.12.9+ent
1.12.9+ent
1.12.10+ent
1.12.10
1.12.10+ent
1.12.10+ent
1.12.10+ent
1.12.11+ent
1.12.11+ent
1.12.11+ent
1.12.11+ent
1.12.11
1.13.0-rc1+ent
1.13.0-rc1+ent
1.13.0-rc1+ent
1.13.0-rc1+ent
1.13.0-rc1
1.13.0+ent
1.13.0+ent
1.13.0+ent
1.13.0+ent
1.13.0
1.13.1
1.13.1+ent
1.13.1+ent
1.13.1+ent
1.13.1+ent
1.13.2+ent
1.13.2+ent
1.13.2+ent
1.13.2+ent
1.13.2
1.13.3
1.13.3+ent
1.13.3+ent
1.13.3+ent
1.13.3+ent
1.13.4
1.13.4+ent
1.13.4+ent
1.13.4+ent
1.13.4+ent
1.13.5+ent
1.13.5+ent
1.13.5
1.13.5+ent
1.13.5+ent
1.13.6
1.13.6+ent
1.13.6+ent
1.13.6+ent
1.13.6+ent
1.13.7+ent
1.13.7
1.13.7+ent
1.13.7+ent
1.13.7+ent
1.13.8+ent
1.13.8+ent
1.13.8+ent
1.13.8
1.13.8+ent
1.13.9+ent
1.13.9+ent
1.13.9
1.13.9+ent
1.13.9+ent
1.13.10+ent
1.13.10
1.13.10+ent
1.13.10+ent
1.13.10+ent
1.13.11+ent
1.13.11+ent
1.13.11+ent
1.13.11
1.13.11+ent
1.13.12+ent
1.13.12+ent
1.13.12+ent
1.13.12
1.13.12+ent
1.14.0-rc1
1.14.0-rc1+ent
1.14.0-rc1+ent
1.14.0-rc1+ent
1.14.0-rc1+ent
1.14.0+ent
1.14.0+ent
1.14.0
1.14.0+ent
1.14.0+ent
1.14.1+ent
1.14.1+ent
1.14.1+ent
1.14.1
1.14.1+ent
1.14.2
1.14.2+ent
1.14.2+ent
1.14.2+ent
1.14.2+ent
1.14.3+ent
1.14.3
1.14.3+ent
1.14.3+ent
1.14.3+ent
1.14.4+ent
1.14.4
1.14.4+ent
1.14.4+ent
1.14.4+ent
1.14.5+ent
1.14.5
1.14.5+ent
1.14.5+ent
1.14.5+ent
1.14.6+ent
1.14.6+ent
1.14.6+ent
1.14.6+ent
1.14.6
1.14.7+ent
1.14.7+ent
1.14.7+ent
1.14.7+ent
1.14.7
1.14.8
1.14.8+ent
1.14.8+ent
1.14.8+ent
1.14.8+ent
1.15.0-rc1+ent
1.15.0-rc1+ent
1.15.0-rc1+ent
1.15.0-rc1+ent
1.15.0-rc1
1.15.0+ent
1.15.0
1.15.0+ent
1.15.0+ent
1.15.0+ent
1.15.1+ent
1.15.1+ent
1.15.1
1.15.1+ent
1.15.1+ent
1.15.2+ent
1.15.2+ent
1.15.2
1.15.2+ent
1.15.2+ent
1.15.3
1.15.3+ent
1.15.3+ent
1.15.3+ent
1.15.3+ent
1.15.4+ent
1.15.4
1.15.4+ent
1.15.4+ent
1.15.4+ent
versions are messed up
asdf latest vault
shows an +ent
version which likely isn't desiredthis is a particular problem for rtx because you effectively need to always use the full version if you don't want to (sometimes) end up with the enterprise version. In rtx it's idiomatic to use partial versions, e.g.: rtx install vault@1
instead of rtx install [email protected]
.
Perhaps I'm using this wrong, but I'm in a weird state. I have both packer and terraform installed via this excellent plugin. On this particular project, I have a .terraform-version file with simply: 0.12.6
(Packer is not needed). When I run asdf install
:
$ asdf install
Downloading packer version 0.12.6 from https://releases.hashicorp.com/packer/0.12.6/packer_0.12.6_darwin_amd64.zip
Error: packer version 0.12.6 not found
My current workaround is to remove the packer plugin, and install it directly without asdf.
macOS strikes again with whitespace in ~/Library/Application Support
:
$ asdf install terraform 1.3.4
Downloading terraform version 1.3.4 from https://releases.hashicorp.com/terraform/1.3.4/terraform_1.3.4_darwin_arm64.zip
Verifying signatures and checksums
gpg: keybox '/var/folders/cf/_7_y2ks145l10nznn4_5l1qh0000gn/T/asdf_terraform_XXXXXX.mW72iEiJ/pubring.kbx' created
gpg: can't open '/Users/ryan/Library/Application': No such file or directory
gpg: can't open 'Support/asdf/plugins/terraform/bin/../hashicorp.asc': No such file or directory
gpg: Total number processed: 0
$
When I try to install Terraform 0.14.10 it fails:
Downloading terraform version 0.14.10 from https://releases.hashicorp.com/terraform/0.14.10/terraform_0.14.10_darwin_arm.zip
Error: terraform version 0.14.10 not found
There isn't an arm release of this version so naturally the download fails, but if it downloaded the amd64 version I could run it under Rosetta 2.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
.github/workflows/workflow.yml
asdf-vm/actions v3
actions/checkout v4
asdf-vm/actions v3
Looks like Hashicorp mangled their terraform artifact names. Starting with 0.12.0-alpha3
, the naming convention is now terraform_0.12.0-alpha4_terraform_0.12.0-alpha4_linux_amd64.zip
, e.g. see here.
I just installed Terraform
using ASDF
. This is the result in the terminal:
[x80486@uplink:~]$ asdf install terraform 1.3.7
Downloading terraform version 1.3.7 from https://releases.hashicorp.com/terraform/1.3.7/terraform_1.3.7_linux_amd64.zip
Verifying signatures and checksums
gpg: keybox '/tmp/asdf_terraform_m7UiU3/pubring.kbx' created
gpg: /tmp/asdf_terraform_m7UiU3/trustdb.gpg: trustdb created
gpg: key 34365D9472D7468F: public key "HashiCorp Security (hashicorp.com/security) <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: Signature made Wed 04 Jan 2023 10:27:45 AM EST
gpg: using RSA key 374EC75B485913604A831CC7C820C6D5CD27AB87
gpg: Good signature from "HashiCorp Security (hashicorp.com/security) <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: C874 011F 0AB4 0511 0D02 1055 3436 5D94 72D7 468F
Subkey fingerprint: 374E C75B 4859 1360 4A83 1CC7 C820 C6D5 CD27 AB87
terraform_1.3.7_linux_amd64.zip: OK
Cleaning terraform previous binaries
Creating terraform bin directory
Extracting terraform archive
I wonder if this should fail because the key couldn't be verified? Otherwise, what's the point on checking it...unless it's part of the Terraform
's built-in install process.
This is a request to either separate the command for each product or provide a simple valid bash command that installs all the plugins within the README.md
Hi,
I've been trying to install terraform using asdf, and while I am able to add the plugin, I can't seem to be able to install any of the versions:
❯ asdf install terraform 0.15.5
Downloading terraform version 0.15.5 from https://releases.hashicorp.com/terraform/0.15.5/terraform_0.15.5_darwin_arm.zip
Error: terraform version 0.15.5 not found
Is there something I am doing wrong?
OS MacOS Big Sur
ASDF version v0.8.1
terraform plugin version is up to date with origin/master
Now that terraform 0.12 has been released, it would be awesome if this plugin could support it! If no one else has the time I can give it a shot, but I figured someone else who as already contributed to this repo could knock it out faster ❤️
$ asdf install terraform 0.12
$ Downloading terraform version 0.12 from https://releases.hashicorp.com/terraform/0.12/terraform_0.12_darwin_amd64.zip
Error: terraform version 0.12 not found
We would need the url to be https://releases.hashicorp.com/terraform/0.12.0/terraform_0.12.0_darwin_amd64.zip
Thank you!
Can you add support for raspberry pi - other platforms
I think it is only matter of checking OS / architecture info and download zip with proper suffix
regards
We're getting build failures on master
related to TF 1.2.0-alpha
:
Run make test
bats test
1..18
ok 1 install command fails if the input is not version number
ok 2 can install and verify earliest terraform
not ok 3 can install and verify latest terraform
# (in test file test/install.bats, line 31)
# `echo "$output" | grep "Extracting terraform archive"' failed
# installing terraform 1.2.0-alpha
ok 4 can install and verify earliest vault
ok 5 can install and verify latest vault
ok 6 can install and verify earliest consul
ok 7 can install and verify latest consul
ok 8 supports legacy terraform version 'required_version' with strict equality
ok 9 supports alternate file for terraform version constraints
ok 10 supports legacy terraform version 'required_version' with strict equality, no equals literal
ok 11 supports legacy file .terraform-version
ok 12 does not support 'not equal' version constraint expressions
ok 13 does not support 'greater than' version constraint expressions
ok 14 does not support 'less than' version constraint expressions
ok 15 does not support squiggly arrow version constraint expressions
ok 16 does not support compound version constraint expressions
ok 17 does not get confused by multiple legacy version files for different plugins
ok 18 does not output error if required_version is not specified
make: *** [Makefile:17: test] Error 1
Error: Process completed with exit code 2.
Need to debug and resolve (or skip it this is irrelevant) so we can test PRs again.
asdf plugin add terraform && asdf install terraform 0.14.10
Downloading terraform version 0.14.10 from https://releases.hashicorp.com/terraform/0.14.10/terraform_0.14.10_linux_amd64.zip
Verifying signatures and checksums
gpg: keybox '/tmp/asdf_terraform_eTk1KC/pubring.kbx' created
gpg: /tmp/asdf_terraform_eTk1KC/trustdb.gpg: trustdb created
gpg: key 34365D9472D7468F: public key "HashiCorp Security (hashicorp.com/security) <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: Signature made Wed Apr 7 18:15:24 2021 UTC
gpg: using RSA key 91A6E7F85D05C65630BEF18951852D87348FFC4C
gpg: Can't check signature: No public key
gpg verification failed
I tried to install version 0.x, but I failed with the following message being displayed. In case installing version 1.x, then successed.
Which cause of this?
$ asdf install terraform 0.12.18
Downloading terraform version 0.12.18 from https://releases.hashicorp.com/terraform/0.12.18/terraform_0.12.18_darwin_arm.zip
Error: terraform version 0.12.18 not found
Check documentation for alternatives https://github.com/asdf-community/asdf-hashicorp#usage
macOS: 13.3.1 (a)
Is there any way to implement shell autocompletion for the hashicorp tools on install?
For example, in my machine I have complete -o nospace -C /usr/local/bin/vault vault
on my .zshrc. From what I can see, if I migrate to an asdf-powered installation of vault I'd have no easy way to run this.
running
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64" vagrant plugin install vagrant-libvirt
yields
(...)
domain.c: En la función ‘ruby_libvirt_domain_init’:
domain.c:5760:29: error: ‘VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK’ (...)
while attempting to build ~/.vagrant.d/gems/2.6.2/gems/ruby-libvirt-0.7.1/ext/libvirt ruby-libvirt, Maybe beacuse the system installed libvirt (6.6.0, fedora 33) is not compatible?
Any help, comments, suggestions are welcome.
Thank you
This is how tfenv solves this issue. It detects the architecture and checks if the version has the arm binary with hard coded versions, if no arm binary, then it downloads x86. This all works without having to override the env var.
It would be nice to have a fallback set
On arm64
# Set fallback arch
ASDF_HASHICORP_OVERWRITE_ARCH_FALLBACK=amd64
# This will install amd64 since arm64 is unavailable
# https://releases.hashicorp.com/terraform/1.0.1/
asdf install terraform 1.0.1
# This will install since arm64 is available
# https://releases.hashicorp.com/terraform/1.0.2/
asdf install terraform 1.0.2
Currently, I'm using this which doesn't do a retry but has a hard coded string for the last_version_before_arm
which is 1.0.1
for terraform.
#!/usr/bin/env sh
asdftf() {
current_version_to_install="$*"
# https://releases.hashicorp.com/terraform/1.0.1/
# https://releases.hashicorp.com/terraform/1.0.2/
last_version_before_arm="1.0.1"
# sort algorithm puts the earliest version first
# ref: https://stackoverflow.com/a/25731924
get_earliest_version=$(printf '%s\n%s' "$last_version_before_arm" "$current_version_to_install" | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g | head -1)
# if the version is the same, that means it's below 1.0.1
if [ "$get_earliest_version" = "$current_version_to_install" ]; then
arch="amd64"
else
arch=$(uname -m)
fi
ASDF_HASHICORP_OVERWRITE_ARCH_TERRAFORM="$arch" asdf install terraform "$current_version_to_install"
}
$ asdftf 1.0.1
Downloading terraform version 1.0.1 from https://releases.hashicorp.com/terraform/1.0.1/terraform_1.0.1_darwin_amd64.zip
$ asdftf 1.0.2
Downloading terraform version 1.0.2 from https://releases.hashicorp.com/terraform/1.0.2/terraform_1.0.2_darwin_arm64.zip
While not necessarily suggesting it should be supported, I wanted to note that there are issues installing nomad-pack
with this plugin.
You should run into the following error:
.asdf/plugins/nomad-pack/bin/install: line 120: ASDF_HASHICORP_OVERWRITE_ARCH_NOMAD-PACK: invalid variable name
I made the following hack locally to resolve the issue
get_arch() {
local -r machine="$(uname -m)"
# local -r upper_toolname=$(echo "${toolname}" | tr '[:lower:]' '[:upper:]')
# local -r tool_specific_arch_override="ASDF_HASHICORP_OVERWRITE_ARCH_${upper_toolname}"
# OVERWRITE_ARCH=${!tool_specific_arch_override:-${ASDF_HASHICORP_OVERWRITE_ARCH:-"false"}}
OVERWRITE_ARCH=${ASDF_HASHICORP_OVERWRITE_ARCH:-"false"}
if [[ $OVERWRITE_ARCH != "false" ]]; then
echo "$OVERWRITE_ARCH"
elif [[ $machine == "arm64" ]] || [[ $machine == "aarch64" ]]; then
echo "arm64"
elif [[ $machine == *"arm"* ]] || [[ $machine == *"aarch"* ]]; then
echo "arm"
elif [[ $machine == *"386"* ]]; then
echo "386"
else
echo "amd64"
fi
}
❯ asdf --version
v0.8.0
❯ asdf plugin list --urls --refs | grep vagrant
vagrant https://github.com/Banno/asdf-hashicorp.git master 4bd2904
❯ asdf list vagrant
No versions installed
❯ asdf list all vagrant
1.4.0
...
2.2.10
❯ asdf install vagrant latest
Downloading vagrant version 2.2.10 from https://releases.hashicorp.com/vagrant/2.2.10/vagrant_2.2.10_darwin_amd64.zip
Error: vagrant version 2.2.10 not found
❯ asdf install vagrant 2.2.10
Downloading vagrant version 2.2.10 from https://releases.hashicorp.com/vagrant/2.2.10/vagrant_2.2.10_darwin_amd64.zip
Error: vagrant version 2.2.10 not found
❯ asdf install vagrant 1.4.0
Downloading vagrant version 1.4.0 from https://releases.hashicorp.com/vagrant/1.4.0/vagrant_1.4.0_darwin_amd64.zip
Error: vagrant version 1.4.0 not found
At https://www.vagrantup.com/downloads.html, I noticed that the MacOS download points to x86_64.dmg
instead of darwin_amd64.zip
at https://releases.hashicorp.com/vagrant/2.2.10/vagrant_2.2.10_x86_64.dmg, could this be the issue?
OVERWRITE_ARCH_TOOL is not null, so ASDF_HASHICORP_OVERWRITE_ARCH is not applied.
Lines 120 to 124 in 3bc5829
OVERWRITE_ARCH_TOOL=${!tool_specific_arch_override:-"false"}
[ $OVERWRITE_ARCH_TOOL == "false" ] && OVERWRITE_ARCH=$ASDF_HASHICORP_OVERWRITE_ARCH || OVERWRITE_ARCH=$OVERWRITE_ARCH_TOOL
if [[ -n $OVERWRITE_ARCH ]]; then
echo "$OVERWRITE_ARCH"
Just installed this plugin onto a clean Ubuntu image and I get the error message:
/root/.asdf/plugins/terraform/bin/install: line 99: unzip: command not found
Easy to fix with
apt-get unzip
but I'd expected this to be documented as a dependancy?
Not sure if this is possible, but it looks like cdktf writes outside of the current project directory which makes using a local .tool-versions
a little tricky.
hashicorp/terraform-cdk#1559 has some info
If this plugin were able to export (TERRAFORM_BINARY_NAME=(local version
) before invoking the shim that might provide a transparent workaround.
Feel free to close if this isn't the sort of thing asdf is able to do. I've never tried to create a plugin for it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.