-
Notifications
You must be signed in to change notification settings - Fork 321
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
Error reading tfstate file: 0.12 format error: <nil>; pre-0.12 format error: <nil> (nil error means no content/modules found in the respective format) #121
Comments
Getting the same issue but using provider.vsphere |
You can try |
#114 see PR for more details |
Indeed, but as you cannot use arguments with ansible, you cannot call it from the --inventory-file option. Or am I doing something wrong?
|
ok, works if |
any plan to fix this without forcing the user to add the TF_STATE variable or the ./ at the end of the command? thank you |
+1 Terraform v0.12.25 |
Working inventory: ansible/inventory/a_terraform.sh: #!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TERRAFORM_INVENTORY=`which terraform-inventory`
TF_STATE="$CURRENT_DIR/../../terraform" # <<== relative path to dir with .tfstate
"$TERRAFORM_INVENTORY" "$@" "$TF_STATE" |
Seems like we need to provide the path to the directory with the .tfstate file. Adding ./ does this. See adammck/terraform-inventory#121
I updated to tf .12.6 and terraform inventory .9, but I'm getting errors that the tfstate is not current. I'm not sure why, because this is a whole new rollout started from scratch with no lingering .11 to my knowledge.
The text was updated successfully, but these errors were encountered: