Manage Windows host : Encoding problem

Hi,

I’m using Ansible 2.5 to manage a Windows Server 2016 node. I configured WinRM like described in the documentation to remotely connect to the node.

I added a host named W1 to the inventory file and under the folder ‘host_vars’ I created the file ‘W1’ that contains the following parameters :

`

Mention the protocol service that you have wnabled on remote. May be credssp or kerberos?

Are you able to share the playbook you are trying to run, the issue you are seeing is that Ansible is trying to throw an exception because it failed to send the module data to the Windows host but because of an encoding issue it isn’t showing you the actual error. We just pushed a fix to work through this issue which should let you know more info as to why it failed https://github.com/ansible/ansible/pull/39333. You can test it out by running from the devel branch of Ansible and it will display the stderr received from the host.

Thanks

Jordan

Hi,

I don’t know exactly, I just executed this Powershell script on my Windows node :

`

powershell.exe  -ExecutionPolicy Bypass -File ConfigureRemotingForAnsible.ps1 -CertValidityDays 3650 -Verbose

`

The ConfigureRemotingForAnsible.ps1 link is :

`
https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1

`

Hi,

I’m not using any playbook, I just used this command : ‘ansible W1 -m ping’

Hi Monta

Are you able to try out the stable branch, there was a change there to fix that encoding issue, it should narrow down exactly what is going wrong. To test it you run the following;

`
git clone https://github.com/ansible/ansible.git
cd ansible
source hacking/env-setup

`

From there you can run ansible W1 -m ping to see how it goes.

Thanks

Jordan

It’s working now ! Thanks.