nbering / terraform-provider-ansible

"Logical" provider for integrating with an Ansible Dynamic Inventory script.
https://nbering.github.io/terraform-provider-ansible/
Mozilla Public License 2.0
329 stars 64 forks source link

Add ansible_group resource #8

Closed jtopjian closed 6 years ago

jtopjian commented 6 years ago

For #3

Hi @nbering!

Around a month ago I created https://github.com/jtopjian/terraform-provider-ansible-inventory. My original name for the provider was terraform-provider-ansibleinventory. I felt that was clunky and wanted to change it to terraform-provider-ansible. That's when I came across your project :smile:

Our work is practically identical, so I'm happy to defer to your project since it was around first (IMO, the problem being solved here is too niche to have more than one solution).

I modified my original ansible_group resource to fit the style laid out in your ansible_host resource. Let me know if you have any questions or would like anything changed.

I also have an Ansible inventory script written in Go here. I will break that out into its own repository and modify it to be compatible with this repo.

nbering commented 6 years ago

Wow, that's awesome! Thanks!

nbering commented 6 years ago

I opted to build the Inventory Script in Python to match the idiomatic language of Ansible (not that I write idiomatic Python). My intent was to make a version that takes advantage of the new Inventory Plugin API in Ansible 2.4... whenever I get around to it.

My original implementation of the inventory script was in TypeScript, just because JSON is easy to manipulate in a JS environment, and I built out type structures to represent the Ansible state format and it made it easier to avoid writing bugs when working with dynamic structures. My Python version is a direct port from my TypeScript code.

jtopjian commented 6 years ago

I have no strong opinion about the choice of language for the dynamic inventory script. I wrote my inventory script in Go because that's what I'm more familiar with. IMO, having a single solution for the inventory side of things is less important than the Terraform side.

I mentioned I would break out my inventory script into its own repo, but that in no way means I want to battle for the official inventory script 😄

My intent was to make a version that takes advantage of the new Inventory Plugin API in Ansible 2.4

ah - I didn't know there was an API. I agree that this would be beneficial.

Thanks for the merge!