Get ansible_ resources from multiple Remote state
See original GitHub issueHaving terraform configuration in different directories/account for secuirity/sepration o duty or something else, can be useful terraform inventory allow to read states from other directories out of the main as current or defined by ANSIBLE_TF_DIR.
E.g. gathering ansible configuration from multimple remote state (multiple directoies in ANSIBLE_TF_DIR), to work like multiple terraform_remote_state in terraform:
data "terraform_remote_state" "dir1" {...}
data "terraform_remote_state" "dir2" {...}
...
data "terraform_remote_state" "dirn" {...}
Every directory will have its backend with aws connection config ti allow this design, probably.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Manage Multiple Servers with Ansible Ad Hoc ...
With Ansible, you can use ad hoc commands to execute one instruction at a time on one or more remote servers. They are...
Read more >Basic Concepts - Ansible Documentation
A list of managed nodes provided by one or more 'inventory sources'. Your inventory can specify information specific to each node, like IP...
Read more >Ansible Network Examples
Using multiple prompts with the ansible.netcommon.cli_command ... Ansible treats the remote node as a network device with a limited execution environment.
Read more >Getting started with Ansible
Ansible automates the management of remote systems and controls their desired state. A basic Ansible environment has three main components: Control node. A ......
Read more >Ansible playbooks
Ansible Playbooks offer a repeatable, re-usable, simple configuration management and multi-machine deployment system, one that is well suited to deploying ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think It is the same. Before you can pull terraform state, you need to know where the state is and how to have access to it. If not on local disk backend.tf (for any remote state configuration) is what allow your script to pull state.
I’ll give a try to multiple inventory “as scripts” using different env var.
I want to thank you for this dynamic inventory script and the terraform ansible provider (a great solution).
To clarify this point… no the script does not try to parse any Terraform files. It calls
terraform state pull
and reads STDOUT to get the state as JSON, letting Terraform figure out where to get the state data from. That way, we can support all remote state providers with zero work from the inventory script.