{"id":13564291,"url":"https://github.com/nbering/terraform-inventory","last_synced_at":"2025-04-13T01:13:38.291Z","repository":{"id":28155040,"uuid":"116499753","full_name":"nbering/terraform-inventory","owner":"nbering","description":"An Ansible dynamic inventory script to pair with nbering/terraform-provider-ansible.","archived":false,"fork":false,"pushed_at":"2022-06-17T21:05:57.000Z","size":137,"stargazers_count":176,"open_issues_count":9,"forks_count":52,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-13T01:13:32.078Z","etag":null,"topics":["ansible","ansible-inventory","terraform"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbering.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-06T16:55:34.000Z","updated_at":"2024-08-29T13:31:52.000Z","dependencies_parsed_at":"2022-08-27T03:06:32.922Z","dependency_job_id":null,"html_url":"https://github.com/nbering/terraform-inventory","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbering%2Fterraform-inventory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbering%2Fterraform-inventory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbering%2Fterraform-inventory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbering%2Fterraform-inventory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbering","download_url":"https://codeload.github.com/nbering/terraform-inventory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650754,"owners_count":21139681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-inventory","terraform"],"created_at":"2024-08-01T13:01:29.285Z","updated_at":"2025-04-13T01:13:38.263Z","avatar_url":"https://github.com/nbering.png","language":"Python","funding_links":[],"categories":["Python","terraform"],"sub_categories":[],"readme":"# Terraform Inventory\n\nAn Ansible [dynamic inventory][2] script to process Terraform state and return\nAnsible host data from [Terraform Provider for Ansible][1] host resources. See the\nTerraform Provider for it's own installation and use.\n\n## Usage\n\nCopy the [terraform.py](./terraform.py) script file to a location on your system. Ansible's own documentation suggests the location `/etc/ansible/terraform.py`, but the particular location does not matter to the script. Ensure it has executable permissions (`chmod +x /etc/ansible/terraform.py`).\n\nWith your Ansible playbook and Terraform configuration in the same directory, run Ansible with the `-i` flag to set the inventory source.\n\n```\n$ ansible-playbook -i /etc/ansible/terraform.py playbook.yml\n```\n\n## Environment Variables\n### ANSIBLE\\_TF\\_BIN\n\nOverride the path to the Terraform command executable. This is useful if you have multiple copies or versions installed and need to specify a specific binary. The inventory script runs the `terraform state pull` command to fetch the Terraform state, so that remote state will be fetched seemlessly regardless of the backend configuration.\n\n### ANSIBLE\\_TF\\_DIR\n\nSet the working directory for the `terraform` command when the scripts shells out to it. This is useful if you keep your terraform and ansible configuration in separate directories. Defaults to using the current working directory.\n\n### ANSIBLE\\_TF\\_WS\\_NAME\n\nSets the workspace for the `terraform` command when the scripts shells out to it, defaults to `default` workspace - if you don't use workspaces this is the one you'll be using. \n\n\n## License\n\nLicensed for use under the [MIT License](./LICENSE).\n\n[1]: https://github.com/nbering/terraform-provider-ansible/\n[2]: http://docs.ansible.com/ansible/latest/intro_dynamic_inventory.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbering%2Fterraform-inventory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbering%2Fterraform-inventory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbering%2Fterraform-inventory/lists"}