Created
January 20, 2016 21:07
-
-
Save x-cray/d96fdc284644b3649770 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro backends(environment) -%} | |
## | |
# {{ environment }} backends | |
## | |
{{ '{{' }}$environment := "{{ environment }}"{{ '}}' }} | |
backend cluster_{{ environment }}:test-server | |
option forwardfor | |
option httpchk GET /healthcheck | |
balance roundrobin{% raw %}{{range $i, $s := service (print $environment ".test-server")}} | |
server {{$s.Node}}-{{$i}} {{$s.Address}}:{{$s.Port}} check inter 10s fall 1 rise 1{{end}}{% endraw %} | |
{%- endmacro %} | |
{{ backends('production') }} | |
{{ backends('staging') }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment