โ Report issues and send Pull Requests in the main Ansible Role repository โ
This role will deal with the setup of HAProxy.
It's part of the Manala Ansible stack but can be used as a stand alone component.
None.
None.
Using ansible galaxy cli:
ansible-galaxy install manala.haproxy
Using ansible galaxy requirements file:
- src: manala.haproxy
Name | Type | Description |
---|---|---|
haproxy restart | Command | Test config and notify "do haproxy restart" handler |
do haproxy restart | Service | Restart haproxy service |
Name | Default | Type | Description |
---|---|---|---|
manala_haproxy_errorfiles_path | /etc/haproxy/errors | String | Errorfiles path |
manala_haproxy_errorfiles | Array | Array | Errorfiles templates |
manala_haproxy_config_path | /etc/haproxy/haproxy.cfg | String | Config path |
manala_haproxy_config_template | config/http_default.cfg.j2 | String | Config template |
manala_haproxy_config | Array | Array | Config |
Handle errorfiles
manala_haproxy_errorfiles:
- name: 400.http
template: errorfiles/400.http.j2
- name: maintenance.http
template: "{{ playbook_dir ~ '/templates/haproxy/errorfiles/maintenance.http.j2' }}"
Use default config template, and set/add custom parameters
manala_haproxy_config:
defaults:
timeout:
- connect 3000
- client 30000
- server 30000
userlist test:
user:
- test insecure-password test
frontend web:
bind: 127.0.0.1:80
acl:
- test hdr_sub(host) -i test.com
use_backend:
- test if test
backend test:
mode: http
server: test test.local:80
acl:
- auth http_auth(test)
http-request: auth realm Customer if !auth
Use custom config template
manala_haproxy_config_template: "{{ playbook_dir ~ '/templates/haproxy/haproxy.cfg.j2' }}"
- hosts: servers
roles:
- { role: manala.haproxy }
MIT
Manala (http://www.manala.io/)