ansible_host + proxy + windows servers (WinRM) not working

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!

Check out environment
https://docs.ansible.com/ansible/latest/playbooks_environment.html

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

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

`

        session.trust_env = True

`

changed to:

`

        session.trust_env = False

`