ansible / terraform-provider-ansible

community terraform provider for ansible
https://registry.terraform.io/providers/ansible/ansible/latest
GNU General Public License v3.0
183 stars 42 forks source link

Support more complex variables types #128

Open raspbeguy opened 3 weeks ago

raspbeguy commented 3 weeks ago

Hello,

When using a ansible_host or ansible_group resource, I wish I could set variables with complex types instead of only strings.

For instances I would like to set a list or a map (those types are supported in static yaml variables files in Ansible). For example I wish I could have this:

resource "ansible_host" "starship" {
  name = "destroyer"
  variables = {
    components = [ "engine", "weapons" ]
  }
]

which would be equivalent to this static Ansible config:

---
components:
  - engine
  - weapons