Haproxy Role
Install and configure HAProxy with HTTP and TCP backends.
Variables
| Variable | Type | Options | Default | Description |
|---|---|---|---|---|
haproxy_service_name | string | --- | haproxy.service | systemd service unit name |
haproxy_service_state | string | reloaded, restarted, started, stopped | started | desired state of the haproxy service |
haproxy_service_enabled | bool | true, false | true | whether the haproxy service is enabled at boot |
haproxy_selinux_permissive | bool | true, false | true | set SELinux to permissive mode for haproxy |
haproxy_package_state | string | present, absent, latest | present | desired state of haproxy packages |
haproxy_package | list of string | --- | ["haproxy"] | list of packages to install |
haproxy_config_path | string | --- | /etc/haproxy/haproxy.cfg | path to the haproxy configuration file |
haproxy_config_ssl | bool | true, false | true | enable SSL/TLS termination |
haproxy_config_force_https | bool | true, false | true | redirect HTTP to HTTPS |
haproxy_config_maxconn | integer | --- | 2000 | maximum concurrent connections |
haproxy_config_http_apps | list 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.name | string | --- | application name | |
haproxy_config_http_apps.domain | string | --- | frontend domain name | |
haproxy_config_http_apps.force_https | bool | true, false | redirect HTTP to HTTPS for this app | |
haproxy_config_http_apps.certificate | string | --- | path to the SSL certificate file | |
haproxy_config_http_apps.servers | list of dict | --- | --- | |
haproxy_config_tcp_apps | list 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.name | string | --- | application name | |
haproxy_config_tcp_apps.port | integer | --- | frontend listen port | |
haproxy_config_tcp_apps.servers | list of dict | --- | --- | |