jonmorehouse / terraform-provisioner-ansible

A provisioner for bootstrapping terraform resources with ansible
526 stars 68 forks source link

why not run ansible-playbook locally? #14

Closed cad closed 8 years ago

cad commented 8 years ago

Why not running ansible-playbook on the host that terraform is being run, instead of running it on the target I wonder?

jonmorehouse commented 8 years ago

@Cad I primarily did this to avoid having to do any potentially, potentially complicated rewiring of the ssh connection from the ansible plugin. Digging through the plugin structure, it seemed a lot more "natural" to just use the built in command execution framework that terraform exposes.

I'm open to suggestions and opinions, however. I'd imagine in a future world, this could be configurable from the plugin itself. If its possible, I don't see any reason to not support running from the target or the terraform host.

cad commented 8 years ago

@jonmorehouse got it. To me it's more preferabble having ansible run on the local because that's the way we are accustomed to do it. That way the target is untouched except for the result of the playbook that we provide. Not to mention benefits of getting rid of the burden to support numerous operating systems on the remote to install ansible for bootstrapping.

wraithm commented 8 years ago

Yeah, people are definitely in general going to be running ansible locally and provisioning many instances with one playbook. I would really like features for creating the inventory file, defining hosts and groups from my instances, and then running one playbook at the end of my provision.

MansM commented 8 years ago

https://github.com/adammck/terraform-inventory I am using this for inventory

cad commented 8 years ago

I got my answer, so closing this issue.