Role Detail

geerlingguy.haproxy

HAProxy installation and configuration.
Downloads
1639
Type Ansible
Minimum Ansible Version 2.2
Installation $ ansible-galaxy install geerlingguy.haproxy
Tags
cloud
networking
web
Last Commit 2017-07-31 18:38:06 PM UTC
Last Imported 2017-10-04 21:30:09 PM UTC
Version History
Version Release Date
1.1.1 2017-07-31 18:38:06 PM
1.1.0 2016-09-03 02:02:02 AM
1.0.3 2016-08-10 02:32:02 AM
1.0.2 2016-06-04 20:47:08 PM
1.0.1 2015-07-19 02:56:02 AM
1.0.0 2015-07-19 01:57:01 AM
0.9.0 2015-07-18 04:26:04 AM
Supported Platforms
Platform Version
EL 6
EL 7
Ubuntu precise
Ubuntu trusty
Ubuntu xenial
Last 10 Imports
Completed Status
2017-10-04 21:30:09 PM UTC SUCCESS
2017-09-30 19:38:07 PM UTC SUCCESS
2017-09-30 19:34:07 PM UTC SUCCESS
2017-09-30 19:32:07 PM UTC SUCCESS
2017-09-30 19:22:07 PM UTC SUCCESS
2017-09-30 14:33:02 PM UTC SUCCESS
2017-07-31 18:43:06 PM UTC SUCCESS
2017-07-31 18:41:06 PM UTC SUCCESS
2017-04-12 16:17:04 PM UTC SUCCESS
2017-04-12 15:51:03 PM UTC SUCCESS

Ansible Role: HAProxy

Build Status

Installs HAProxy on RedHat/CentOS and Debian/Ubuntu Linux servers.

Note: This role officially supports HAProxy versions 1.4 or 1.5. Future versions may require some rework.

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

haproxy_socket: /var/lib/haproxy/stats

The socket through which HAProxy can communicate (for admin purposes or statistics). To disable/remove this directive, set haproxy_socket: '' (an empty string).

haproxy_chroot: /var/lib/haproxy

The jail directory where chroot() will be performed before dropping privileges. To disable/remove this directive, set haproxy_chroot: '' (an empty string). Only change this if you know what you're doing!

haproxy_user: haproxy
haproxy_group: haproxy

The user and group under which HAProxy should run. Only change this if you know what you're doing!

haproxy_frontend_name: 'hafrontend'
haproxy_frontend_bind_address: '*'
haproxy_frontend_port: 80
haproxy_frontend_mode: 'http'

HAProxy frontend configuration directives.

haproxy_backend_name: 'habackend'
haproxy_backend_mode: 'http'
haproxy_backend_balance_method: 'roundrobin'
haproxy_backend_httpchk: 'HEAD / HTTP/1.1\r\nHost:localhost'

HAProxy backend configuration directives.

haproxy_backend_servers:
  - name: app1
    address: 192.168.0.1:80
  - name: app2
    address: 192.168.0.2:80

A list of backend servers (name and address) to which HAProxy will distribute requests.

haproxy_global_vars:
  - 'ssl-default-bind-ciphers ABCD+KLMJ:...'
  - 'ssl-default-bind-options no-sslv3'

A list of extra global variables to add to the global configuration section inside haproxy.cfg.

Dependencies

None.

Example Playbook

- hosts: balancer
  sudo: yes
  roles:
    - { role: geerlingguy.haproxy }

License

MIT / BSD

Author Information

This role was created in 2015 by Jeff Geerling, author of Ansible for DevOps.

None