Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for errorfiles in listen and backend blocks and more global ssl settings #80

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions haproxy/templates/haproxy.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ global
{%- if 'ssl-default-bind-options' in salt['pillar.get']('haproxy:global', {}) %}
{{- render_list_of_dictionaries('ssl-default-bind-options', salt['pillar.get']('haproxy:global:ssl-default-bind-options')) }}
{%- endif %}
{%- if 'ssl-default-server-ciphers' in salt['pillar.get']('haproxy:global', {}) %}
{{- render_list_of_dictionaries('ssl-default-server-ciphers', salt['pillar.get']('haproxy:global:ssl-default-server-ciphers')) }}
{%- endif %}
{%- if 'ssl-default-server-options' in salt['pillar.get']('haproxy:global', {}) %}
{{- render_list_of_dictionaries('ssl-default-server-options', salt['pillar.get']('haproxy:global:ssl-default-server-options')) }}
{%- endif %}
{%- if 'ssl-default-bind-ciphersuites' in salt['pillar.get']('haproxy:global', {}) %}
{{- render_list_of_dictionaries('ssl-default-bind-ciphersuites', salt['pillar.get']('haproxy:global:ssl-default-bind-ciphersuites')) }}
{%- endif %}
{%- if 'ssl-default-server-ciphersuites' in salt['pillar.get']('haproxy:global', {}) %}
{{- render_list_of_dictionaries('ssl-default-server-ciphersuites', salt['pillar.get']('haproxy:global:ssl-default-server-ciphersuites')) }}
{%- endif %}
{%- if 'extra' in salt['pillar.get']('haproxy:global', {}) %}
{%- if salt['pillar.get']('haproxy:global:extra', {}) is string %}
{{ salt['pillar.get']('haproxy:global:extra') }}
Expand Down Expand Up @@ -200,6 +212,11 @@ listen {{ listener.get('name', listener_name) }}
{%- if 'mode' in listener %}
mode {{ listener.mode }}
{%- endif %}
{%- if 'errorfiles' in listener %}
{%- for errorfile_name, errorfile in listener.errorfiles|dictsort %}
errorfile {{ errorfile_name }} {{ errorfile }}
{%- endfor %}
{% endif %}
{%- if 'hashtype' in listener %}
hash-type {{ listener.hashtype }}
{%- endif %}
Expand Down Expand Up @@ -485,6 +502,11 @@ backend {{ backend.get('name', backend_name) }}
{%- if 'mode' in backend %}
mode {{ backend.mode }}
{%- endif %}
{%- if 'errorfiles' in backend %}
{%- for errorfile_name, errorfile in backend.errorfiles|dictsort %}
errorfile {{ errorfile_name }} {{ errorfile }}
{%- endfor %}
{% endif %}
{%- if 'hashtype' in backend %}
hash-type {{ backend.hashtype }}
{%- endif %}
Expand Down
1 change: 1 addition & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ haproxy:
- realm: 'Haproxy\ Statistics'
- auth: 'admin1:AdMiN123'

# the same can be set in a per backend/listen as well
errorfiles:
400: /etc/haproxy/errors/400.http
403: /etc/haproxy/errors/403.http
Expand Down