Note
This module is part of the community.windows collection (version 2.4.0).
You might already have this collection installed if you are using the ansible package. 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 community.windows.
To use it in a playbook, specify: community.windows.win_inet_proxy.
Parameter | Comments |
|---|---|
auto_config_url string | The URL of a proxy configuration script. Proxy configuration scripts are typically JavaScript files with the Omit, set to null or an empty string to remove the auto config URL. This corresponds to the checkbox Use automatic configuration script in the connection settings window. |
auto_detect boolean | Whether to configure WinINet to automatically detect proxy settings through Web Proxy Auto-Detection This corresponds to the checkbox Automatically detect settings in the connection settings window. Choices:
|
bypass list / elements=string | A list of hosts that will bypass the set proxy when being accessed. Use 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. |
connection string | The name of the IE connection to set the proxy settings for. These are the connections under the Dial-up and Virtual Private Network header in the IE settings. When omitted, the default LAN connection is used. |
proxy any | 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. |
Note
netsh command. Use the community.windows.win_http_proxy module to manage that instead.See also
Manages proxy settings for WinHTTP.
Manages Windows Credentials in the Credential Manager.
# This should be set before running the win_inet_proxy module
- name: Configure IE proxy settings to apply to all users
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
name: ProxySettingsPerUser
data: 0
type: dword
state: present
# This should be set before running the win_inet_proxy module
- name: Configure IE proxy settings to apply per user
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
name: ProxySettingsPerUser
data: 1
type: dword
state: present
- name: Configure IE proxy to use auto detected settings without an explicit proxy
win_inet_proxy:
auto_detect: true
- name: Configure IE proxy to use auto detected settings with a configuration script
win_inet_proxy:
auto_detect: true
auto_config_url: http://proxy.ansible.com/proxy.pac
- name: Configure IE to use explicit proxy host
win_inet_proxy:
auto_detect: true
proxy: ansible.proxy
- name: Configure IE to use explicit proxy host with port and without auto detection
win_inet_proxy:
auto_detect: false
proxy: ansible.proxy:8080
- name: Configure IE to use a specific proxy per protocol
win_inet_proxy:
proxy:
http: ansible.proxy:8080
https: ansible.proxy:8443
- name: Configure IE to use a specific proxy per protocol using a string
win_inet_proxy:
proxy: http=ansible.proxy:8080;https=ansible.proxy:8443
- name: Set a proxy with a bypass list
win_inet_proxy:
proxy: ansible.proxy
bypass:
- server1
- server2
- <-loopback>
- <local>
- name: Remove any explicit proxies that are set
win_inet_proxy:
proxy: ''
bypass: ''
# This should be done after setting the IE proxy with win_inet_proxy
- name: Import IE proxy configuration to WinHTTP
win_http_proxy:
source: ie
# Explicit credentials can only be set per user and require become to work
- name: Set credential to use for proxy auth
win_credential:
name: ansible.proxy # The name should be the FQDN of the proxy host
type: generic_password
username: proxyuser
secret: proxypass
state: present
become: true
become_user: '{{ ansible_user }}'
become_method: runas
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/windows/win_inet_proxy_module.html