Skip to main content

Haproxy Role

Install and configure HAProxy with HTTP and TCP backends.


Variables​

VariableTypeOptionsDefaultDescription
haproxy_service_namestring---haproxy.servicesystemd service unit name
haproxy_service_statestringreloaded, restarted, started, stoppedstarteddesired state of the haproxy service
haproxy_service_enabledbooltrue, falsetruewhether the haproxy service is enabled at boot
haproxy_selinux_permissivebooltrue, falsetrueset SELinux to permissive mode for haproxy
haproxy_package_statestringpresent, absent, latestpresentdesired state of haproxy packages
haproxy_packagelist of string---["haproxy"]list of packages to install
haproxy_config_pathstring---/etc/haproxy/haproxy.cfgpath to the haproxy configuration file
haproxy_config_sslbooltrue, falsetrueenable SSL/TLS termination
haproxy_config_force_httpsbooltrue, falsetrueredirect HTTP to HTTPS
haproxy_config_maxconninteger---2000maximum concurrent connections
haproxy_config_http_appslist of dict---[{"name":"example-app1","domain":"example.com","force_https":true,"certificate":"/etc/ssl/example-app1.pem","servers":[{"name":"example_server1","host":"192.168.1.101","port":8080},{"name":"example_server2","host":"192.168.1.102","port":8080}]}]list of HTTP frontend/backend definitions
haproxy_config_http_apps.namestring---application name
haproxy_config_http_apps.domainstring---frontend domain name
haproxy_config_http_apps.force_httpsbooltrue, falseredirect HTTP to HTTPS for this app
haproxy_config_http_apps.certificatestring---path to the SSL certificate file
haproxy_config_http_apps.serverslist of dict------
haproxy_config_tcp_appslist of dict---[{"name":"example-tcp-app1","port":3306,"servers":[{"name":"example_server1","host":"192.168.1.101","port":3306},{"name":"example_server2","host":"192.168.1.102","port":3306}]}]list of TCP frontend/backend definitions
haproxy_config_tcp_apps.namestring---application name
haproxy_config_tcp_apps.portinteger---frontend listen port
haproxy_config_tcp_apps.serverslist of dict------