Currently, the extra_vars parameter is just a map of key-value pairs (string only). However, in Ansible we can pass extra vars as a JSON string, allowing us to pass more data types / structures.
The Terraform provider should take advantage of this feature.
Proposal
Parse the extra_vars map, and encode it as a JSON string to pass to Ansible. This would easily allow us to define native HCL types for extra_vars. Looking at the code, it seems like it would be relatively easy to implement this change.
Issue
Currently, the
extra_vars
parameter is just a map of key-value pairs (string only). However, in Ansible we can pass extra vars as a JSON string, allowing us to pass more data types / structures.For example:
The Terraform provider should take advantage of this feature.
Proposal
Parse the
extra_vars
map, and encode it as a JSON string to pass to Ansible. This would easily allow us to define native HCL types forextra_vars
. Looking at the code, it seems like it would be relatively easy to implement this change.