We attempt to use here ansible 1.8.2 to manage windows servers 2008 → 2012.
We attempt to test actually on windows 2012 server with PowerShell 4 and using french LangPack
We have followed the ansible documentation for windows server configuration and winrm module installation on ansible server.
When we attempt to launch the win-ping module on this server, the ansible server attempt to gather facts using a script named setup.ps1.
Ansible break on this fact gathering with the following error :
$ ansible-playbook --limit test-windows2 windows_inventory.yml -vv
PLAY [grp-windows] ************************************************************
GATHERING FACTS ***************************************************************
REMOTE_MODULE setup
fatal: [test-windows2] => Traceback (most recent call last):
File “/usr/lib/pymodules/python2.7/ansible/runner/init.py”, line 590, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/lib/pymodules/python2.7/ansible/runner/init.py”, line 792, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File “/usr/lib/pymodules/python2.7/ansible/runner/init.py”, line 1025, in _executor_internal_inner
result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
File “/usr/lib/pymodules/python2.7/ansible/runner/action_plugins/normal.py”, line 57, in run
return self.runner._execute_module(conn, tmp, module_name, module_args, inject=inject, complex_args=complex_args)
File “/usr/lib/pymodules/python2.7/ansible/runner/init.py”, line 555, in _execute_module
res = self._low_level_exec_command(conn, cmd, tmp, sudoable=sudoable, in_data=in_data)
File “/usr/lib/pymodules/python2.7/ansible/runner/init.py”, line 1173, in _low_level_exec_command
in_data=in_data)
File “/usr/lib/pymodules/python2.7/ansible/runner/connection_plugins/winrm.py”, line 153, in exec_command
return (result.status_code, ‘’, result.std_out.encode(‘utf-8’), result.std_err.encode(‘utf-8’))
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0x8a in position 53: ordinal not in range(128)
I attempt to run directly the setup.ps1 script on the server which generate error.
This error is printed with french characters which perhaps generate the UnicodeDecodeError.
Anyone can confirm it use ansible on windows servers with non english langpack ?
Thanks for your help