Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inventory_hostname from Terraform resource name #124

Open
bentinata opened this issue Aug 26, 2019 · 1 comment
Open

inventory_hostname from Terraform resource name #124

bentinata opened this issue Aug 26, 2019 · 1 comment

Comments

@bentinata
Copy link

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?

@cacack
Copy link

cacack commented Jun 2, 2020

I like this idea, just for the improved readability of the Ansible output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants