Support for haproxy
New in version 2014.7.0.
salt.modules.haproxyconn.disable_server(name, backend, socket='/var/run/haproxy.sock')¶Disable server in haproxy.
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.disable_server db1.example.com mysql
salt.modules.haproxyconn.enable_server(name, backend, socket='/var/run/haproxy.sock')¶Enable Server in haproxy
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.enable_server web1.example.com www
salt.modules.haproxyconn.get_backend(backend, socket='/var/run/haproxy.sock')¶Receive information about a specific backend.
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.get_backend mysql
salt.modules.haproxyconn.get_sessions(name, backend, socket='/var/run/haproxy.sock')¶New in version 2016.11.0.
Get number of current sessions on server in backend (scur)
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.get_sessions web1.example.com www
salt.modules.haproxyconn.get_weight(name, backend, socket='/var/run/haproxy.sock')¶Get server weight
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.get_weight web1.example.com www
salt.modules.haproxyconn.list_backends(servers=True, socket='/var/run/haproxy.sock')¶List HaProxy Backends
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.list_backends
salt.modules.haproxyconn.list_frontends(socket='/var/run/haproxy.sock')¶List HaProxy frontends
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.list_frontends
salt.modules.haproxyconn.list_servers(backend, socket='/var/run/haproxy.sock', objectify=False)¶List servers in haproxy backend.
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.list_servers mysql
salt.modules.haproxyconn.set_state(name, backend, state, socket='/var/run/haproxy.sock')¶Force a server’s administrative state to a new state. This can be useful to disable load balancing and/or any traffic to a server. Setting the state to “ready” puts the server in normal mode, and the command is the equivalent of the “enable server” command. Setting the state to “maint” disables any traffic to the server as well as any health checks. This is the equivalent of the “disable server” command. Setting the mode to “drain” only removes the server from load balancing but still allows it to be checked and to accept new persistent connections. Changes are propagated to tracking servers if any.
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.set_state my_proxy_server my_backend ready
salt.modules.haproxyconn.set_weight(name, backend, weight=0, socket='/var/run/haproxy.sock')¶Set server weight
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.set_weight web1.example.com www 13
salt.modules.haproxyconn.show_backends(socket='/var/run/haproxy.sock')¶Show HaProxy Backends
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.show_backends
salt.modules.haproxyconn.show_frontends(socket='/var/run/haproxy.sock')¶Show HaProxy frontends
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.show_frontends
salt.modules.haproxyconn.wait_state(backend, server, value='up', timeout=300, socket='/var/run/haproxy.sock')¶Wait for a specific server state
/var/run/haproxy.sockCLI Example:
salt '*' haproxy.wait_state mysql server01 up 60
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2018.3.3