radekg / terraform-provisioner-ansible

Ansible with Terraform 0.14.x
Apache License 2.0
572 stars 100 forks source link

Ensure that the output from remote provisioner command contains valid… #141

Closed radekg closed 4 years ago

radekg commented 4 years ago

… UTF-8. Closes #139.

Summary

As per https://github.com/hashicorp/terraform/issues/22856#issuecomment-533300018, relevant bit:

The Terraform language and protocols consider
strings to be unicode and thus requires strings
arriving via wire protocols to be UTF-8 encoded,
so unfortunately it's by design that non-UTF-8
strings cannot be returned here, but since this
seems to just be general progress output emitted
by the provisioner, it is probably okay for the
provisioner to pre-sanitize these strings to replace
non-UTF-8 sequences with the replacement
character so that the rest of the message is still
readable.

This PR attempts to fix the problem.