-
Notifications
You must be signed in to change notification settings - Fork 52
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
workspaces not supported #23
Comments
Try running I checked the Ansible changelog to see if there's breaking changes lately, but the docs claim continued compatibility with inventory scripts. Still... it might help to know what version of Ansible and Terraform you're using. |
By the way... actual error you're getting says Ansible is trying to read your script file as a static ini-formatted inventory file. This might mean the permissions were not correct to execute the file, or perhaps it failed to execute and Ansible is falling back to parsing it as a static inventory. |
@Rafaelrico7 I had the same problem. It seems like gitlab does not (yet) support workspaces, so I removed these lines https://github.com/nbering/terraform-inventory/blob/master/terraform.py#L374-L381 and removed one level of indentation for these lines https://github.com/nbering/terraform-inventory/blob/master/terraform.py#L382-L390. In addition, I had to remove the With those modifications I was able to use this script, hope it helps. @nbering Thanks for the script 💐 |
@nbering I had the same error as well. I'm running Terraform version 0.14.6 and Python 3.8.5. To fix it I changed terraform-inventory/terraform.py Line 374 in 1e8dfee
I wonder if there was an update to Terraform that caused the issue |
Hi
I'm using the Gitlab Remote State Backend for my terraform state.
While executing the terraform.py I get the following error:
$ ansible-playbook -i /etc/ansible/terraform.py ../ansible/playbook.yml [WARNING]: * Failed to parse /etc/ansible/terraform.py with script plugin: Inventory script (/etc/ansible/terraform.py) had an execution error: workspaces not supported [WARNING]: * Failed to parse /etc/ansible/terraform.py with ini plugin: /etc/ansible/terraform.py:2: Error parsing host definition ''''': No closing quotation [WARNING]: Unable to parse /etc/ansible/terraform.py as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
chmod +x was executed on the file and I also tried:
ANSIBLE_TF_DIR=/path/to/terraform/workdir/ ansible -i terraform.py ...
what is my error?
The text was updated successfully, but these errors were encountered: