Hello,
I’m working on getting some scheduled tasks on AWX for Windows servers, which will basically copy (with win_copy) some powershell scripts from the remote server and then run these scripts on the Windows servers (with win_command).
I define the following host vars for the Windows servers:
ansible_user: user
ansible_password: password
ansible_port: 5985
ansible_connection: winrm
ansible_winrm_transport: ntlm
ansible_become: false
ansible_winrm_server_cert_validation: ignore
ansible_winrm_operation_timeout_sec: 120
ansible_winrm_read_timeout_sec: 180
These are the tasks:
-
name: Copy folder contents recursively
win_copy:
src: files/
dest: C:\Utils\scripts -
name: Run powershell scripts
win_command: powershell.exe -ExecutionPolicy Unrestricted -File C:\Utils\scripts\install_app.ps1
Both tasks return the error:
“msg”: “ntlm: (u’http’, u’Bad HTTP response returned from server. Code 500’)”,
I was running AWX 1.0.2 (docker image) with Ansible 2.4.2, but tried upgrading to Ansible 2.5.2 and still get the same error.
Fact 1: I don’t have any issues running this playbook from my local machine (OSX), also running Ansible 2.5.2.
Fact 2: I’ve connected to the container (docker exec), went to the project folder (under /var/lib/awx/projects/) and tried to run the playbook from there, it worked like a charm.
Fact 3: I’ve installed pywinrm in the container, didn’t make a difference.
I was wondering if AWX is throwing extra stuff (e.g. environment and/or extra variables) that could be causing the problem for me.
Any help is appreciated.
Regards,
Marcus