salt.modules.proxy module

This module allows you to manage proxy settings

salt '*' network.get_http_proxy
salt.modules.proxy.get_ftp_proxy(network_service='Ethernet')

Returns the current ftp proxy settings

network_service
The network service to apply the changes to, this only necessary on OSX

CLI Example:

salt '*' proxy.get_ftp_proxy Ethernet
salt.modules.proxy.get_http_proxy(network_service='Ethernet')

Returns the current http proxy settings

network_service
The network service to apply the changes to, this only necessary on OSX

CLI Example:

salt '*' proxy.get_http_proxy Ethernet
salt.modules.proxy.get_https_proxy(network_service='Ethernet')

Returns the current https proxy settings

network_service
The network service to apply the changes to, this only necessary on OSX

CLI Example:

salt '*' proxy.get_https_proxy Ethernet
salt.modules.proxy.get_proxy_bypass(network_service='Ethernet')

Returns the current domains that can bypass the proxy

network_service
The network service to get the bypass domains from, this is only necessary on OSX

CLI Example:

salt '*' proxy.get_proxy_bypass
salt.modules.proxy.get_proxy_win()

Gets all of the proxy settings in one call, only available on Windows

CLI Example:

salt '*' proxy.get_proxy_win
salt.modules.proxy.set_ftp_proxy(server, port, user=None, password=None, network_service='Ethernet', bypass_hosts=None)

Sets the ftp proxy settings

server
The proxy server to use
port
The port used by the proxy server
user
The username to use for the proxy server if required
password
The password to use if required by the server
network_service
The network service to apply the changes to, this only necessary on OSX
bypass_hosts
The hosts that are allowed to by pass the proxy. Only used on Windows for other OS's use set_proxy_bypass to edit the bypass hosts.

CLI Example:

salt '*' proxy.set_ftp_proxy example.com 1080 user=proxy_user password=proxy_pass network_service=Ethernet
salt.modules.proxy.set_http_proxy(server, port, user=None, password=None, network_service='Ethernet', bypass_hosts=None)

Sets the http proxy settings. Note: On Windows this will override any other proxy settings you have, the preferred method of updating proxies on windows is using set_proxy.

server
The proxy server to use
port
The port used by the proxy server
user
The username to use for the proxy server if required
password
The password to use if required by the server
network_service
The network service to apply the changes to, this only necessary on OSX
bypass_hosts
The hosts that are allowed to by pass the proxy. Only used on Windows for other OS's use set_proxy_bypass to edit the bypass hosts.

CLI Example:

salt '*' proxy.set_http_proxy example.com 1080 user=proxy_user password=proxy_pass network_service=Ethernet
salt.modules.proxy.set_https_proxy(server, port, user=None, password=None, network_service='Ethernet', bypass_hosts=None)

Sets the https proxy settings. Note: On Windows this will override any other proxy settings you have, the preferred method of updating proxies on windows is using set_proxy.

server
The proxy server to use
port
The port used by the proxy server
user
The username to use for the proxy server if required
password
The password to use if required by the server
network_service
The network service to apply the changes to, this only necessary on OSX
bypass_hosts
The hosts that are allowed to by pass the proxy. Only used on Windows for other OS's use set_proxy_bypass to edit the bypass hosts.

CLI Example:

salt '*' proxy.set_https_proxy example.com 1080 user=proxy_user password=proxy_pass network_service=Ethernet
salt.modules.proxy.set_proxy_bypass(domains, network_service='Ethernet')

Sets the domains that can bypass the proxy

domains
An array of domains allowed to bypass the proxy
network_service
The network service to apply the changes to, this only necessary on OSX

CLI Example:

salt '*' proxy.set_proxy_bypass "['127.0.0.1', 'localhost']"
salt.modules.proxy.set_proxy_win(server, port, types=None, bypass_hosts=None)

Sets the http proxy settings, only works with Windows.

server
The proxy server to use
password
The password to use if required by the server
types
The types of proxy connections should be setup with this server. Valid types are http and https.
bypass_hosts
The hosts that are allowed to by pass the proxy.

CLI Example:

salt '*' proxy.set_http_proxy example.com 1080 types="['http', 'https']"