terraform-inventory
terraform-inventory copied to clipboard
inventory_hostname from Terraform resource name
Currently, any resource is written as single group in inventory.
For example, this Terraform:
resource "aws_instance" "my_instance" {
ami = data.aws_ami.ubuntu.id
instance_type = "t2.micro"
}
Would yield:
[my_instance]
127.0.1.1
# or whatever the ip address is
I think, having it as:
my_instance ansible_host=127.0.1.1
would be better since we can refer to inventory_hostname from inside the playbook.
I haven't dive into the source code yet. I might want to make a pull request if this is desirable. Thoughts?
I like this idea, just for the improved readability of the Ansible output.