And another one...

I have a PowerShell script that I copy to a Windows host via the 
win_template module.
Then I go and use the raw module to execute that script:

- name: Copy PowerShell script to remote host
  win_template:
    src: /container/ansible/roles/test/templates/download_s3_bucket.ps1.j2
    dest: "c:\\s3downloads\\download_s3_bucket.ps1"

- name: Download Installer from S3 bucket
  raw: "powershell.exe -ExecutionPolicy Bypass -File 
'c:\\s3downloads\\download_s3_bucket.ps1'"


The second task continuously fails, all the time, after about 60 seconds.

This is the output:

TASK [Download Installer from S3 bucket] **********************************
task path: /container/ansible/roles/test/tasks/configure-ec2.yml:15
<ip-10-178-72-114.ap-southeast-2.compute.internal> ESTABLISH WINRM CONNECTION 
FOR USER: Administrator on PORT 5986 TO 
ip-10-178-72-114.ap-southeast-2.compute.internal
<ip-10-178-72-114.ap-southeast-2.compute.internal> EXEC powershell.exe 
-ExecutionPolicy Bypass -File 'c:\s3downloads\download_s3_bucket.ps1'

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", 
line 244, in exec_command
    result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", 
line 212, in _winrm_exec
    self.protocol.cleanup_command(self.shell_id, command_id)
  File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 290, in 
cleanup_command
    rs = self.send_message(xmltodict.unparse(rq))
  File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 193, in 
send_message
    return self.transport.send_message(message)
  File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 138, in 
send_message
    raise WinRMTransportError('http', ex.reason)
WinRMTransportError: 500 WinRMTransport. [Errno 110] Connection timed out

fatal: [ip-10-178-72-114.ap-southeast-2.compute.internal]: FAILED! => 
{"failed": true, "msg": "failed to exec cmd powershell.exe -ExecutionPolicy 
Bypass -File 'c:\\s3downloads\\download_s3_bucket.ps1'"}


It looks like transport.py doesn't have a timeout set higher than the 
default for HTTPS connections, only for HTTP it is set to self.timeout = 
3600.
Am I right in thinking that we need to patch transport.py for longer 
lasting HTTPS connections?

I am on Ansible 2.0.1, I'm running it on Centos and against a Windows 
Server 2012R2.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/135ed873-4519-45cf-9904-6c1a7167277b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to