However this workaround has it's limitations eg. using the combine() function to merge some dicts together.
Terraform saves simple_map as an string and combine() will fail as it can't combine/merge an dict/map with an string.
For this issue we have also an workaround. Using | from_json in the combine() function will convert the string into an dict/map again and the merge will work again.
It is really sad that this provider doesn't support Maps or Lists in the variables field.
It would be really helpful for us as we don't need to implement any of those workarounds to deal with different variable types.
Hey there, we have found out that this provider only accepts strings in the variables field in
ansible_group
andansible_host
.map example:
Error:
Our current workaround for this is using the
jsonencode
function in terraform.However this workaround has it's limitations eg. using the
combine()
function to merge some dicts together. Terraform savessimple_map
as an string and combine() will fail as it can't combine/merge an dict/map with an string.Another example for this issue: terraform:
ansible:
Error:
For this issue we have also an workaround. Using
| from_json
in the combine() function will convert the string into an dict/map again and the merge will work again.It is really sad that this provider doesn't support Maps or Lists in the variables field. It would be really helpful for us as we don't need to implement any of those workarounds to deal with different variable types.
Thanks!