ansible windows error

364 views
Skip to first unread message

lozair31

unread,
Jan 16, 2015, 2:40:28 AM1/16/15
to ansible...@googlegroups.com
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 ***************************************************************
<test-windows2> 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

Chris Church

unread,
Jan 16, 2015, 1:12:18 PM1/16/15
to ansible...@googlegroups.com
I'm able to reproduce against a French AMI (ami-4cff9b24) by running:

ansible -i inventory -m raw -a "ipconfig" -vvvv windows

I'm working on a fix, and trying to determine if it's really an ansible or pywinrm issue.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f9c89e9b-980e-419e-b1e3-15a74dd11540%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Church

unread,
Jan 16, 2015, 2:22:29 PM1/16/15
to ansible...@googlegroups.com
I've found and submitted a fix: https://github.com/ansible/ansible/pull/10024

lozair31

unread,
Jan 28, 2015, 5:33:32 PM1/28/15
to ansible...@googlegroups.com
Thks for your help !
I will make a try
Reply all
Reply to author
Forward
0 new messages