{"id":16780565,"url":"https://github.com/monolithprojects/ansible-tfvars2facts","last_synced_at":"2025-10-29T21:18:45.350Z","repository":{"id":115679440,"uuid":"230801426","full_name":"MonolithProjects/ansible-tfvars2facts","owner":"MonolithProjects","description":"This role will help you to use the Terraform variables (tfvars) as Ansible local facts.","archived":false,"fork":false,"pushed_at":"2020-07-09T11:02:43.000Z","size":289,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T20:21:26.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/monolithprojects/tfvars2facts","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/MonolithProjects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-12-29T20:45:14.000Z","updated_at":"2020-07-09T11:02:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"216f2f22-92dc-4909-985a-d30076d91664","html_url":"https://github.com/MonolithProjects/ansible-tfvars2facts","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/MonolithProjects/ansible-tfvars2facts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2Fansible-tfvars2facts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2Fansible-tfvars2facts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2Fansible-tfvars2facts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2Fansible-tfvars2facts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MonolithProjects","download_url":"https://codeload.github.com/MonolithProjects/ansible-tfvars2facts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2Fansible-tfvars2facts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281699816,"owners_count":26546393,"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","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"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-10-13T07:35:25.848Z","updated_at":"2025-10-29T21:18:45.305Z","avatar_url":"https://github.com/MonolithProjects.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tfvars2facts (Ansible Role)\n\n[![Galaxy Quality](https://img.shields.io/ansible/quality/45539?style=flat\u0026logo=ansible)](https://galaxy.ansible.com/monolithprojects/tfvars2facts)\n[![Role version](https://img.shields.io/github/v/release/MonolithProjects/ansible-tfvars2facts)](https://galaxy.ansible.com/monolithprojects/tfvars2facts)\n[![Role downloads](https://img.shields.io/ansible/role/d/45539)](https://galaxy.ansible.com/monolithprojects/tfvars2facts)\n[![GitHub Actions](https://github.com/MonolithProjects/ansible-tfvars2facts/workflows/molecule%20test/badge.svg?branch=master)](https://github.com/MonolithProjects/ansible-tfvars2facts/actions)\n[![License](https://img.shields.io/github/license/MonolithProjects/ansible-tfvars2facts)](https://github.com/MonolithProjects/ansible-tfvars2facts/blob/master/LICENSE)\n\nThis Ansible role translates the Terraform tfvrs file to Ansible Local Facts.\nThe result is saved on the remote host(s) in /etc/ansib.e/facts.d/ directory as JSON file.  \n\nYou can query the tfvars variables in Ansible by following syntax `{{ ansible_local['tfvars']['my_variable'] }}`.  \n\n**Note:**\nSince the Ansible variable names can not contain the dash sign, the dash sign(s) will be replaced by underscore.  \nFor example `my-var-1` will be `my_var_1`.\n\n## Requirements\n\n* Ansible 2.8+\n\n* Role must run in privileged mode (`become: yes`)\n\n## Role Variables\n\nThis is a copy from `defaults/main.yml`\n\n```yaml\n# Path to Ansible local facts\nlocal_facts_path: /etc/ansible/facts.d\n\n# Local facts file name. If changed for example to \"different_file.facts\",\n# also the key will be {{ ansible_local['different_file']['some_variable'] }}\nlocal_facts_file: tfvars.fact\n\n# Enable if used with DT Pan-Net ALiEn (Application Lifecycle Engine)\nALiEn: false\n\n# Path to Terraform variables file\n# (ommited if variable ALiEn is true)\ntfvars_path: files\n\n# Terraform variables file name\ntfvars_file: vars.tfvars\n\n# Reload the Ansible facts after local facts are created\nreload_facts: false\n```\n\n## Example Playbook\n\nIn this example the role will translate Terraform variables in `files/vars.tfvars` and will upload it as an Ansible facts file to the remote hosts.\nThe role will also reload the Ansible Facts, so the new facts will be ready for the next role/post_task.\n\n```yaml\n---\n- name: Simple Example\n  hosts: all\n  become: yes\n  vars:\n    reload_facts: yes\n  roles:\n    - role: ansible-tfvars2facts\n```\n\n## License\n\nMIT\n\n## Author Information\n\nCreated in 2020 by Michal Muransky/DT Pan-Net\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonolithprojects%2Fansible-tfvars2facts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonolithprojects%2Fansible-tfvars2facts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonolithprojects%2Fansible-tfvars2facts/lists"}