community.windows.win_inet_proxy – Manages proxy settings for WinINet and Internet Explorer¶
Note
This plugin is part of the community.windows collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_inet_proxy
.
Synopsis¶
Used to set or remove proxy settings for Windows INet which includes Internet Explorer.
WinINet is a framework used by interactive applications to submit web requests through.
The proxy settings can also be used by other applications like Firefox, Chrome, and others but there is no definitive list.
Parameters¶
Notes¶
Note
This is not the same as the proxy settings set in WinHTTP through the
netsh
command. Use the community.windows.win_http_proxy module to manage that instead.These settings are by default set per user and not system wide. A registry property must be set independently from this module if you wish to apply the proxy for all users. See examples for more detail.
If per user proxy settings are desired, use become to become any local user on the host. No password is needed to be set for this to work.
If the proxy requires authentication, set the credentials using the community.windows.win_credential module. This requires become to be used so the credential store can be accessed.
See Also¶
See also
- community.windows.win_http_proxy
The official documentation on the community.windows.win_http_proxy module.
- community.windows.win_credential
The official documentation on the community.windows.win_credential module.
Examples¶
# 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: yes
- name: Configure IE proxy to use auto detected settings with a configuration script
win_inet_proxy:
auto_detect: yes
auto_config_url: http://proxy.ansible.com/proxy.pac
- name: Configure IE to use explicit proxy host
win_inet_proxy:
auto_detect: yes
proxy: ansible.proxy
- name: Configure IE to use explicit proxy host with port and without auto detection
win_inet_proxy:
auto_detect: no
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: yes
become_user: '{{ ansible_user }}'
become_method: runas
Authors¶
Jordan Borean (@jborean93)