-
Notifications
You must be signed in to change notification settings - Fork 4.4k
tf/aws: add download-version tf var #8599
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
base: main
Are you sure you want to change the base?
Conversation
curl -L "${download_url}" > /tmp/vault.zip | ||
vault_download_url=https://releases.hashicorp.com/vault/${download_version}/vault_${download_version}_linux_amd64.zip | ||
|
||
if [[ ! -z "${download_url}" ]]; then |
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.
I find positive conditions easier to read than negative ones. I might suggest changing the ! -z
to -n
, as I believe they are equivalent. I don't think the double brackets are required here either. I think single brackets would suffice.
@@ -6,7 +6,13 @@ sudo apt-get update -y | |||
sudo apt-get install -y curl unzip | |||
|
|||
# Download Vault into some temporary directory | |||
curl -L "${download_url}" > /tmp/vault.zip | |||
vault_download_url=https://releases.hashicorp.com/vault/${download_version}/vault_${download_version}_linux_amd64.zip |
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.
It's probably worth wrapping this URL in double quotes, since there are variables in it. See https://github.com/koalaman/shellcheck/wiki/SC2086 for more details.
vault_download_url=https://releases.hashicorp.com/vault/${download_version}/vault_${download_version}_linux_amd64.zip | ||
|
||
if [[ ! -z "${download_url}" ]]; then | ||
vault_download_url=${download_url} |
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.
Same comment here as above re: double quotes.
Small PR to add a
download-version
TF variable while still acceptingdownload-url
if that's provided.