devops-coop / ansible-haproxy

Installs and configure HAProxy
Apache License 2.0
96 stars 97 forks source link

Add http-request option to frontends #20

Closed pieterlexis closed 9 years ago

pieterlexis commented 9 years ago

This allows the use of the 'http-request' option for frontends, eg.:


---
haproxy_frontends:
  - name: "http-in"
    bind:
      - "{{ ansible_eth0.ipv4.address }}:80"
    default-backend: 'public-http'
    acl:
      - name: 'Users-auth-ok'
        condition: 'http_auth(users)'
    http_request:
      - action: allow
        condition: 'if Users-auth-ok'
      - action: 'auth'
        param: 'realm "My secret server"'
        condition: 'if !Users-auth-ok'
      - action: 'deny'
PierrePaul commented 9 years ago

I never used http-request in the past. It seems to be a very handy feature. Thanks your pull request :)