-
Notifications
You must be signed in to change notification settings - Fork 321
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
Ansible HostGroup Support #16
Comments
Yes, this would be very useful, especially when multiple identical resources are created with Terraform's |
+1 |
3 similar comments
+1 |
+1 |
+1 |
Working on a little patch with @jbehling that should help with this. You can find it here master...jackspirou:master The idea is that {
"mongoc":["10.10.10.101","10.10.10.102","10.10.10.103"],
"mongos":["10.10.10.101","10.10.10.102","10.10.10.103"],
"mongosc":["10.10.10.101","10.10.10.102","10.10.10.103"],
"server.0":["10.10.10.101"],
"server.1":["10.10.10.102"],
"server.2":["10.10.10.103"]
} |
+1 |
Please check out #22 for an implementation of this. Feedback would be very much appreciated. |
@adammck So glad I found this today :) I'm just doing some elasticsearch stuff with terraform and ansible so needed groups. Works perfectly, however just an FYI from terraform that you'll need to come up with a different strategy for naming things.
|
Thanks for the heads up, @johnwards! I don't entirely understand the warning, since those resource names -- something.index -- were presumably generated by Terraform itself, via the |
Ah, so this might be my problem I guess. I directly named my ec2 instances:
So in this case this is my bad for not realising there is a count param and putting it in manually, but I do think that having instances of different settings (security groups, instance size etc) but in the same group is probably a valid use case and you could achieve it this way? |
At present there doesn't appear to be a way to output the data from terraform as Ansible Host Groups to allow for multiple hosts to be configured via a single play.
For example, a play that starts with "hosts: webservers" doesn't know that "aws_instance.webserver.0" should belong to the "webservers" ansible group.
It would be nice to have some way of mapping aws_instance.webserver.* to a group or similar.
The text was updated successfully, but these errors were encountered: