Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geerlingguy/ansible-role-haproxy
Ansible Role - HAProxy
https://github.com/geerlingguy/ansible-role-haproxy
ansible haproxy load-balancer performance proxy reverse-proxy role scalability webserver
Last synced: 2 days ago
JSON representation
Ansible Role - HAProxy
- Host: GitHub
- URL: https://github.com/geerlingguy/ansible-role-haproxy
- Owner: geerlingguy
- License: mit
- Created: 2015-07-18T04:27:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-19T07:37:50.000Z (6 months ago)
- Last Synced: 2024-10-10T04:06:31.147Z (4 months ago)
- Topics: ansible, haproxy, load-balancer, performance, proxy, reverse-proxy, role, scalability, webserver
- Language: Jinja
- Homepage: https://galaxy.ansible.com/geerlingguy/haproxy/
- Size: 48.8 KB
- Stars: 212
- Watchers: 8
- Forks: 190
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-ansible-roles - geerlingguy.haproxy - Installs HAProxy on RedHat/CentOS and Debian/Ubuntu Linux servers. (Reverse Proxy / Webservers)
- awesome-network-stuff - **81**星 - HAProxy (<a id="d03d494700077f6a65092985c06bf8e8"></a>工具 / <a id="d3069cac6097830d12f5933c9c8b7a77"></a>HAProxy)
- awesome-list-ansible - ansible-role-haproxy - HAProxy (webserver)
README
# Ansible Role: HAProxy
[![CI](https://github.com/geerlingguy/ansible-role-haproxy/actions/workflows/ci.yml/badge.svg)](https://github.com/geerlingguy/ansible-role-haproxy/actions/workflows/ci.yml)
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`):
```yaml
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).
```yaml
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!
```yaml
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!
```yaml
haproxy_frontend_name: 'hafrontend'
haproxy_frontend_bind_address: '*'
haproxy_frontend_port: 80
haproxy_frontend_mode: 'http'
```HAProxy frontend configuration directives.
```yaml
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.
```yaml
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.
```yaml
haproxy_connect_timeout: 5000
haproxy_client_timeout: 50000
haproxy_server_timeout: 50000
```HAProxy default timeout configurations.
```yaml
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`.
```yaml
haproxy_template: haproxy.cfg.j2
```Use this variable to override the configuration template used by this role. Copy out the template file from this role's `templates` folder into your own playbook's `templates` folder to override.
## Dependencies
None.
## Example Playbook
```yaml
- hosts: balancer
sudo: yes
roles:
- { role: geerlingguy.haproxy }
```## License
MIT / BSD
## Author Information
This role was created in 2015 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).