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-file=terraform-inventory does not yield hosts #29

Closed
kevinlondon opened this issue Feb 17, 2016 · 5 comments
Closed

--inventory-file=terraform-inventory does not yield hosts #29

kevinlondon opened this issue Feb 17, 2016 · 5 comments

Comments

@kevinlondon
Copy link

Following the README currently does not find the proper executable script for inventory. Instead, I found I had to use which terraform-inventory to reverse the path of the executable. Here's some example output (which has been trimmed):

$ terraform-inventory --list
{"db":["54.208.224.51"], . . . }
$ ansible -i terraform-inventory all -m ping
[WARNING]: provided hosts list is empty, only localhost is available

$ ansible -i `which terraform-inventory` all -m ping
54.208.224.51 | . . .

I'm on Ansible 2.0.0.2 currently.

@adammck
Copy link
Owner

adammck commented Feb 18, 2016

Oops! Sorry about that. Thanks for reporting.

@andrefbsantos
Copy link
Contributor

I'm currently experiencing the same issue.

@kevinlondon I hacked terraform-inventory and manage to make it produce an host file which can be fed to Ansible, https://github.com/andrefbsantos/terraform-inventory/tree/add_inventory_option.

@adammck I made a pull request which provides the --inventory option to produce an host file which can fed to Ansible to remote provision. While it's not a solution for this particular issue, it allows the creation of an host file from the terraform state file and make a bridge between terraform and ansible.

@nicolaballotta
Copy link

Hi @adammck, any plan to fix this?

@adammck
Copy link
Owner

adammck commented May 19, 2016

Yes, thanks for the reminder, @nballotta. I think this is just a documentation bug, right? It seems like ansible requires the full path to the dynamic inventory executable rather than searching the $PATH.

@nicolaballotta
Copy link

@adammck oh yes! Sorry I noticed now that with full path currently works :)

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

4 participants