Support for haproxy
New in version 2014.7.0.
Disable server in haproxy.
Server to disable
haproxy backend, or all backends if "*" is supplied
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.disable_server db1.example.com mysql
Enable Server in haproxy
Server to enable
haproxy backend, or all backends if "*" is supplied
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.enable_server web1.example.com www
Receive information about a specific backend.
haproxy backend
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.get_backend mysql
New in version 2016.11.0.
Get number of current sessions on server in backend (scur)
Server name
haproxy backend
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.get_sessions web1.example.com www
Get server weight
Server name
haproxy backend
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.get_weight web1.example.com www
List HaProxy Backends
haproxy stats socket, default /var/run/haproxy.sock
list backends with servers
CLI Example:
salt '*' haproxy.list_backends
List HaProxy frontends
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.list_frontends
List servers in haproxy backend.
haproxy backend
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.list_servers mysql
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.
Server name
haproxy backend
A string of the state to set. Must be 'ready', 'drain', or 'maint'
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.set_state my_proxy_server my_backend ready
Set server weight
Server name
haproxy backend
Server Weight
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.set_weight web1.example.com www 13
Show HaProxy Backends
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.show_backends
Show HaProxy frontends
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.show_frontends
Wait for a specific server state
haproxy backend
targeted server
state value
timeout before giving up state value, default 5 min
haproxy stats socket, default /var/run/haproxy.sock
CLI Example:
salt '*' haproxy.wait_state mysql server01 up 60