emmetog.haproxy
Ansible Role: HAProxy
This role installs HAProxy on RedHat/CentOS and Debian/Ubuntu Linux servers.
Note: This role supports HAProxy versions 1.4 and 1.5. Newer versions may need some adjustments.
Note: This role is based on geerlingguy/ansible-role-haproxy with some changes to make it more flexible.
Requirements
No requirements.
Role Variables
Here are the available variables and their default values (check defaults/main.yml for details):
haproxy_sockets:- Example:
"/var/lib/haproxy/stats level admin" - These are the sockets HAProxy uses for communication (for administrative tasks or statistics). To disable this, set
haproxy_sockets: [](an empty list).
- Example:
haproxy_chroot:- Example:
/var/lib/haproxy - The directory where chroot() will occur before reducing privileges. To disable this, set
haproxy_chroot: ''(an empty string). Change this only if you know what you're doing!
- Example:
haproxy_user:- Default:
haproxy - The user that will run HAProxy. Change this only if you know what you're doing!
- Default:
haproxy_group:- Default:
haproxy - The group that will run HAProxy. Change this only if you know what you're doing!
- Default:
haproxy_log_destination:- Default:
/dev/log - The default log destination, which you usually won’t need to change.
- Default:
haproxy_backend_timeout:- Default:
50000 - The timeout (in milliseconds) for backend servers to respond. It's suggested that this value matches the client timeout.
- Default:
haproxy_defaults:- Example:
[] - Any settings to add to the "defaults" section.
- Example:
haproxy_frontend_servers:- Example:
[] - HAProxy frontend configuration commands.
- Example:
haproxy_backend_servers:- Example:
[] - HAProxy backend configuration commands.
- Example:
haproxy_global_vars:- Example:
'ssl-default-bind-ciphers ABCD+KLMJ:...''ssl-default-bind-options no-sslv3'
- A list of additional global variables for the HAProxy configuration file.
- Example:
haproxy_restarted_status:- Default:
restarted - The status of the HAProxy service after configuration changes.
- Default:
Dependencies
No dependencies.
Example Playbook
- hosts: balancer
sudo: yes
roles:
- { role: geerlingguy.haproxy }
License
MIT / BSD
Author Information
This role was originally created in 2015 by Jeff Geerling, who wrote Ansible for DevOps. This version is maintained by Emmet O'Grady.
HAProxy installation and configuration.
ansible-galaxy install emmetog.haproxy