ansible_host + proxy + windows servers (WinRM) not working

248 views
Skip to first unread message

Mike Klebolt

unread,
Aug 10, 2017, 11:29:41 AM8/10/17
to Ansible Project
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!


Kai Stian Olstad

unread,
Aug 10, 2017, 1:04:59 PM8/10/17
to ansible...@googlegroups.com
On 10. aug. 2017 17:29, Mike Klebolt wrote:
> 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


--
Kai Stian Olstad

Kai Stian Olstad

unread,
Aug 10, 2017, 1:12:26 PM8/10/17
to ansible...@googlegroups.com
I was a little fast there, I now see you wrote local environment.

--
Kai Stian Olstad

Mike Klebolt

unread,
Aug 14, 2017, 10:23:07 AM8/14/17
to Ansible Project, ansible-pr...@olstad.com
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




Reply all
Reply to author
Forward
0 new messages