When installing terraform via the script, it installs v0.11.11. Which is 2 versions behind the latest version which is v0.11.13.
When editing the script, I changed the PACKAGE_VERSION from 0.11.11 to 0.11.13. This seems like it should redo the install and update the version of terraform. But it fails the script's check to see if the the current PACKAGE_VERSION var is install on the system.
This is do the the output of terraform when issuing the command terraform version on a outdated version.
Terraform v0.11.11
Your version of Terraform is out of date! The latest version
is 0.11.13. You can update by downloading from www.terraform.io/downloads.html
As you can see terraform states the current version as 0.11.11 but also outputs a message about upgrading the the current version of 0.11.13.
So when issuing this command in the script, currently its issuing terraform version | grep "$PACKAGE_VERSION", which will not work. Since if you replace the PACKAGE_VERSION with the current version of 0.11.13 the grep statement will find it in the output and state the current version install on the system is 0.11.13. Thus there is no reason to update.
One possible solution would be to narrow down the grep statement to terraform version | grep "Terraform v$PACKAGE_VERSION"
Just an FYI the current output from a terraform version on the up to date version is:
When installing terraform via the script, it installs v0.11.11. Which is 2 versions behind the latest version which is v0.11.13.
When editing the script, I changed the
PACKAGE_VERSION
from0.11.11
to0.11.13
. This seems like it should redo the install and update the version of terraform. But it fails the script's check to see if the the currentPACKAGE_VERSION
var is install on the system.This is do the the output of terraform when issuing the command
terraform version
on a outdated version.As you can see terraform states the current version as
0.11.11
but also outputs a message about upgrading the the current version of0.11.13
.So when issuing this command in the script, currently its issuing
terraform version | grep "$PACKAGE_VERSION"
, which will not work. Since if you replace thePACKAGE_VERSION
with the current version of0.11.13
the grep statement will find it in the output and state the current version install on the system is0.11.13
. Thus there is no reason to update.One possible solution would be to narrow down the grep statement to
terraform version | grep "Terraform v$PACKAGE_VERSION"
Just an FYI the current output from a
terraform version
on the up to date version is: