Skip to content

cmihai-ansible/haproxy

Repository files navigation

Role Name

haproxy

Build Status

Ansible galaxy:

https://galaxy.ansible.com/crivetimihai/haproxy

ansible-galaxy install crivetimihai.haproxy

Requirements

  • For RHEL, a Red Hat subscription or functional local repository.

Role Variables

# 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

Dependencies

  • For Red Hat, subscription-manager.

Example Playbook

---
- 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: haproxy

License

MIT

Author Information

About

Ansible haproxy role

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages