Coder Social home page Coder Social logo

melfors / ansible-role-haproxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from manala/ansible-role-haproxy

0.0 1.0 0.0 29 KB

[READ-ONLY] Ansible role dealing with the setup of HAProxy

Home Page: https://galaxy.ansible.com/manala/haproxy/

Makefile 100.00%

ansible-role-haproxy's Introduction

Ansible Role: HAProxy Build Status

โ— Report issues and send Pull Requests in the main Ansible Role repository โ—

This role will deal with the setup of HAProxy.

It's part of the Manala Ansible stack but can be used as a stand alone component.

Requirements

None.

Dependencies

None.

Installation

Ansible 2+

Using ansible galaxy cli:

ansible-galaxy install manala.haproxy

Using ansible galaxy requirements file:

- src: manala.haproxy

Role Handlers

Name Type Description
haproxy restart Command Test config and notify "do haproxy restart" handler
do haproxy restart Service Restart haproxy service

Role Variables

Name Default Type Description
manala_haproxy_errorfiles_path /etc/haproxy/errors String Errorfiles path
manala_haproxy_errorfiles Array Array Errorfiles templates
manala_haproxy_config_path /etc/haproxy/haproxy.cfg String Config path
manala_haproxy_config_template config/http_default.cfg.j2 String Config template
manala_haproxy_config Array Array Config

Configuration example

Handle errorfiles

manala_haproxy_errorfiles:
  - name: 400.http
    template: errorfiles/400.http.j2
  - name: maintenance.http
    template: "{{ playbook_dir ~ '/templates/haproxy/errorfiles/maintenance.http.j2' }}"

Use default config template, and set/add custom parameters

manala_haproxy_config:
  defaults:
    timeout:
      - connect 3000
      - client  30000
      - server  30000
  userlist test:
    user:
      - test insecure-password test
  frontend web:
    bind: 127.0.0.1:80
    acl:
      - test hdr_sub(host) -i test.com
    use_backend:
      - test if test
  backend test:
    mode: http
    server: test test.local:80
    acl:
      - auth http_auth(test)
    http-request: auth realm Customer if !auth

Use custom config template

manala_haproxy_config_template: "{{ playbook_dir ~ '/templates/haproxy/haproxy.cfg.j2' }}"

Example playbook

- hosts: servers
  roles:
    - { role: manala.haproxy }

Licence

MIT

Author information

Manala (http://www.manala.io/)

ansible-role-haproxy's People

Contributors

nervo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.