Ansible setting - add proxy

154 views
Skip to first unread message

Pierre Ochsenbein

unread,
Feb 5, 2020, 11:41:12 AM2/5/20
to Ansible Project
Guys,

how we can add proxy setting in ansible when we use ansible_connection=winrm?

fatal: [10.2.20.56]: UNREACHABLE! => {
    "changed": false,
    "msg": "ssl: HTTPSConnectionPool(host='10.2.20.56', port=5986): Max retries exceeded with url: /wsman (Caused by ProxyError('Cannot connect to proxy.', error(104, 'Connection reset by peer')))",
    "unreachable": true
}

Andre Gronwald

unread,
Feb 6, 2020, 3:37:02 PM2/6/20
to Ansible Project
you want to use a proxy for reaching remote server, or you want to change proxy setting on the remote server?
regards,
andre

Pierre Ochsenbein

unread,
Feb 7, 2020, 3:01:15 AM2/7/20
to Ansible Project
######
###### How to fix Proxy error
######

- Locate transport.py that comes with pywinrm
- Modify the following line session.trust to make it false

# session.trust_env = True
session.trust_env = False

TASK [../roles/windows-files : Touch file for test] ****************************************************************************************************
 [WARNING]: ansible_winrm_read_timeout unsupported by pywinrm (is an up-to-date version of pywinrm installed?)

changed: [10.21.20.56]

PLAY RECAP *********************************************************************************************************************************************
10.21.20.56                : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0


Reply all
Reply to author
Forward
0 new messages