haproxy
https://galaxy.ansible.com/crivetimihai/haproxy
ansible-galaxy install crivetimihai.haproxy- For RHEL, a Red Hat subscription or functional local repository.
# defaults file for haproxy
# Service
haproxy_enable_service: true
haproxy_copy_templates: true
haproxy_firewall_configure: true
haproxy_firewall_rules:
- service: http
# Frontend
haproxy_frontend_port: 80
# Backend
haproxy_backend_name: app
haproxy_backend_port: 80
haproxy_backend_servers:
- name: web01
address: 192.168.0.1
- name: web02
address: 192.168.0.2- For Red Hat, subscription-manager.
---
- name: Install haproxy on localhost
hosts:
- localhost
connection: local
tasks:
- name: haproxy is configured
import_role:
name: crivetimihai.haproxy
vars:
# defaults file for haproxy
# Service
haproxy_enable_service: true
haproxy_copy_templates: true
haproxy_firewall_configure: true
haproxy_firewall_rules:
- service: http
# Frontend
haproxy_frontend_port: 80
# Backend
haproxy_backend_name: app
haproxy_backend_port: 80
haproxy_backend_servers:
- name: web01
address: 192.168.0.1
- name: web02
address: 192.168.0.2
tags: haproxyMIT