ansible.windows.win_http_proxy module – Manages proxy settings for WinHTTP
Note
This module is part of the ansible.windows collection (version 3.0.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ansible.windows
.
To use it in a playbook, specify: ansible.windows.win_http_proxy
.
New in ansible.windows 2.7.0
Synopsis
Used to set, remove, or import proxy settings for Windows HTTP Services
WinHTTP
.WinHTTP is a framework used by applications or services, typically .NET applications or non-interactive services, to make web requests.
Parameters
Parameter |
Comments |
---|---|
A list of hosts that will bypass the set proxy when being accessed. Use Omit, set to null or an empty string/list to remove the bypass list. If this is set then proxy must also be set. |
|
A string or dict that specifies the proxy to be set. If setting a string, should be in the form If the port is undefined, the default port for the protocol in use is used. If setting a dict, the keys should be the protocol and the values should be the hostname and/or port for that protocol. Valid protocols are Omit, set to null or an empty string to remove the proxy settings. |
|
Instead of manually specifying the proxy and/or bypass, set this to import the proxy from a set source like Internet Explorer. Using Only IE’s proxy URL and bypass list will be imported into WinHTTP. This is like running The value is imported when the module runs and will not automatically be updated if the IE configuration changes in the future. The module will have to be run again to sync the latest changes. Choices:
|
Notes
Note
This is not the same as the proxy settings set in Internet Explorer, also known as
WinINet
; use the ansible.windows.win_inet_proxy module to manage that instead.These settings are set system wide and not per user, it will require Administrative privileges to run.
Examples
- name: Set a proxy to use for all protocols
ansible.windows.win_http_proxy:
proxy: hostname
- name: Set a proxy with a specific port with a bypass list
ansible.windows.win_http_proxy:
proxy: hostname:8080
bypass:
- server1
- server2
- <local>
- name: Set the proxy based on the IE proxy settings
ansible.windows.win_http_proxy:
source: ie
- name: Set a proxy for specific protocols
ansible.windows.win_http_proxy:
proxy:
http: hostname:8080
https: hostname:8443
- name: Set a proxy for specific protocols using a string
ansible.windows.win_http_proxy:
proxy: http=hostname:8080;https=hostname:8443
bypass: server1,server2,<local>
- name: Remove any proxy settings
ansible.windows.win_http_proxy:
proxy: ''
bypass: ''