{"id":20567808,"url":"https://github.com/isometry/ansible-collection-terraform","last_synced_at":"2026-06-05T19:31:16.645Z","repository":{"id":68239063,"uuid":"387268791","full_name":"isometry/ansible-collection-terraform","owner":"isometry","description":"Read Terraform outputs for use in Ansible","archived":false,"fork":false,"pushed_at":"2022-08-23T16:07:19.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T17:02:09.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isometry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-18T21:04:08.000Z","updated_at":"2022-08-23T16:07:23.000Z","dependencies_parsed_at":"2023-02-22T23:31:29.177Z","dependency_job_id":null,"html_url":"https://github.com/isometry/ansible-collection-terraform","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/isometry/ansible-collection-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometry%2Fansible-collection-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometry%2Fansible-collection-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometry%2Fansible-collection-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometry%2Fansible-collection-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isometry","download_url":"https://codeload.github.com/isometry/ansible-collection-terraform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometry%2Fansible-collection-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33957496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-16T04:48:34.193Z","updated_at":"2026-06-05T19:31:16.619Z","avatar_url":"https://github.com/isometry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Collection Terraform\n\nRead [Terraform](https://www.terraform.io/) outputs for use in Ansible.\n\n## Features \n\n* Supports direct retrieval from Terraform Cloud/Enterprise.\n* Supports arbitrary local modules with any backend configuration.\n* Retrieve all outputs or just a specified subset.\n\n## Installation\n\n```sh\nansible-galaxy collection install isometry.terraform\n```\n\n## Configuration\n\n### Local Terraform Module\n\nTo retrieve outputs from a local module available via filesystem path, just the `path` to the module is required.\n\nA version of `terraform` binary compatible with the targeted module must also be executable within `PATH`.\n\n### Terraform Cloud\n\nTo retrieve outputs from a Terraform Cloud workspace, the relevant `organization`, `workspace` and an API `token` must be configured. These may be:\n\n* specified as key-value arguments to the lookup (e.g. `lookup('isometry.terraform.output', organization='my-org', workspace='my-workspace', token='my-token')`);\n* set as variables with the `ansible_lookup_terraform_` prefix (i.e. `ansible_lookup_terraform_organization`/`ansible_lookup_terraform_workspace`/`ansible_lookup_terraform_token`);\n* specified via the environment with either the `ANSIBLE_LOOKUP_TERRAFORM_` or `TF_` prefix (i.e. `TF_ORGANIZATION`/`TF_WORKSPACE`/`TF_TOKEN`);\n  * The `token` may also be specified in a [terraform-credentials-env](https://github.com/apparentlymart/terraform-credentials-env)-compatible environment variable (e.g. `TF_TOKEN_app_terraform_io` for Terraform Cloud) for simplified use in automation.\n* set within the `[terraform_lookup]` section of `ansible.cfg`.\n\n### Terraform Enterprise\n\nInteraction with Terraform Enterprise is untested, but in theory has the same requirements as Terraform Cloud, in addition to which the `address` must be configured.\n\n## Example Usage\n\n```yaml\n- name: retrieve all outputs from our-workspace in my-org\n  debug:\n    msg: \"{{ lookup('isometry.terraform.output', organization='my-org', workspace='our-workspace') }}\"\n\n- name: retrieve all outputs from local terraform module my-module\n  debug:\n    msg: \"{{ lookup('isometry.terraform.output', path='my-module') }}\"\n\n- name: set server_address fact from terraform\n  set_fact:\n    server_address: \"{{ lookup('isometry.terraform.output', 'server_address', organization='my-org', workspace='our-workspace') }}\"\n\n- name: dump items in servers output map\n  debug:\n    var: item\n  loop: \"{{ lookup('isometry.terraform.output', 'servers', path='my-module') | dict2items }}\"\n\n- name: cache terraform output in terraform_output fact\n  set_fact:\n    cacheable: yes\n    terraform_output: \"{{ lookup('isometry.terraform.output', organization='my-org', workspace='our-workspace') }}\"\n\n- name: transform all terraform outputs from my-module into ansible facts\n  set_fact:\n    \"{{ item.key }}\": \"{{ item.value }}\"\n  loop: \"{{ lookup('isometry.terraform.output', path='my-module') }}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisometry%2Fansible-collection-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisometry%2Fansible-collection-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisometry%2Fansible-collection-terraform/lists"}