# ansible\_host + proxy + windows servers (WinRM) not working

**URL:** <https://forum.ansible.com/t/ansible-host-proxy-windows-servers-winrm-not-working/25222>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 10, 2017, 3:29pm UTC](https://forum.ansible.com/t/ansible-host-proxy-windows-servers-winrm-not-working/25222 "2017-08-10T15:29:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Klebolt](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mike\_Klebolt](https://forum.ansible.com/u/Mike_Klebolt)\
**Post date:** [August 10, 2017, 3:29pm UTC](https://forum.ansible.com/t/ansible-host-proxy-windows-servers-winrm-not-working/25222/1 "2017-08-10T15:29:41Z")

</div>

Hello,

We’re using ansible on some windows servers. The ansible\_host is configured with a proxy and is preventing us from connecting to the windows hosts. My current workaround involves manually exporting no\_proxy with the windows server IPs. While this gets us connected, I still feel like there should be a better way to go about this. I tried creating a localaction that would add the no\_proxy entry to ~/.bashrc and reload bash, but it looks like ansible uses the same env that it initially started with. I was wondering if there was a way for ansible to set up a local environment (not remote) during a playbook run that would setup no\_proxy on its own.

Any help is greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 10, 2017, 5:04pm UTC](https://forum.ansible.com/t/ansible-host-proxy-windows-servers-winrm-not-working/25222/2 "2017-08-10T17:04:26Z")

</div>

Check out environment  
[https://docs.ansible.com/ansible/latest/playbooks\_environment.html](https://docs.ansible.com/ansible/latest/playbooks_environment.html)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 10, 2017, 5:12pm UTC](https://forum.ansible.com/t/ansible-host-proxy-windows-servers-winrm-not-working/25222/3 "2017-08-10T17:12:07Z")

</div>

I was a little fast there, I now see you wrote local environment.

---

<div class="post-metadata">

**Author:** ![Mike\_Klebolt](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mike\_Klebolt](https://forum.ansible.com/u/Mike_Klebolt)\
**Post date:** [August 14, 2017, 2:23pm UTC](https://forum.ansible.com/t/ansible-host-proxy-windows-servers-winrm-not-working/25222/4 "2017-08-14T14:23:07Z")

</div>

I was able to resolve this issue by modifying one of the lines in transport.py for pywinrm.

`

```auto
        session.trust_env = True

```

`

changed to:

`

```auto
        session.trust_env = False

```

`
