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

switch to use ansible-playbook + generated inventory #13

Open
jonmorehouse opened this issue Mar 15, 2016 · 3 comments
Open

switch to use ansible-playbook + generated inventory #13

jonmorehouse opened this issue Mar 15, 2016 · 3 comments

Comments

@jonmorehouse
Copy link
Owner

After some digging into the the source of ansible a bit more, it seems like a few features are going to be trickier to implement than originally anticipated, most notably the following:

  • vault password encryption / decryption
  • become password
  • tags

I think a better approach would be to focus on generating an inventory file, similar to how vagrant and packer do, uploading said inventory file and then running ansible-playbook on the host itself. It seems like this would allow us to have better feature parity with ansible and would vastly simplify the setup!

Here's how I could see all this working out...

  1. specify config args which match the arguments that can be passed into ansible-playbook in the terraform module itself
  2. add the ability to customize, via terraform variables the following: hostgroups, groups, vars, roles, tags etc. Basically, let's attempt to match feature parity of what an inventory file can hold
  3. Generate, from our configuration, a json inventory file and then upload it to the host.
  4. Run ansible-playbook on the host itself, using our uploaded configuration file.

We would still end up wanting to give users the ability to specify #5, but I think this would be a good solution to #9.

@jonmorehouse jonmorehouse changed the title switch to use ansible-playbook switch to use ansible-playbook + generated inventory Mar 15, 2016
@jonmorehouse
Copy link
Owner Author

A few other nice side effects of not using ansible-local.py anymore:

  • we can store our generated inventory file as a terraform output. Maybe this could allow users of the plugin to "re-deploy"?
  • we aren't as tightly coupled to any specific version of ansible
  • this is much, much easier to test!

@binarymist
Copy link

Hi @jonmorehouse, any update on how this is progressing, if it is?

@sohail-prodevans
Copy link

i wanted to write a play for any kind of switch, please help me

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

3 participants