It looks like the copy module uses jinja to write out what was passed to it via “content”. Since this is a binary file, jinja fails:
fatal: [sf-web01] => Traceback (most recent call last):
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 561, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 666, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 870, in _executor_internal_inner
module_args = template.template(self.basedir, module_args, inject, fail_on_undefined=self.error_on_undefined_vars)
File “/usr/lib/python2.6/site-packages/ansible/utils/template.py”, line 115, in template
varname = template_from_string(basedir, varname, vars, fail_on_undefined)
File “/usr/lib/python2.6/site-packages/ansible/utils/template.py”, line 357, in template_from_string
res = jinja2.utils.concat(rf)
File “”, line 10, in root
File “/usr/lib64/python2.6/encodings/utf_8.py”, line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xa9 in position 0: invalid start byte
fatal: [sf-web02] => Traceback (most recent call last):
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 561, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 666, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 870, in _executor_internal_inner
module_args = template.template(self.basedir, module_args, inject, fail_on_undefined=self.error_on_undefined_vars)
File “/usr/lib/python2.6/site-packages/ansible/utils/template.py”, line 115, in template
varname = template_from_string(basedir, varname, vars, fail_on_undefined)
File “/usr/lib/python2.6/site-packages/ansible/utils/template.py”, line 357, in template_from_string
res = jinja2.utils.concat(rf)
File “”, line 10, in root
File “/usr/lib64/python2.6/encodings/utf_8.py”, line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xa9 in position 0: invalid start byte
If there is another way for me to accomplish this using the built-in modules, please let me know.