Merge pull request #42 from cybacolt/master

Allow omission of 'port' and 'check' from server params
This commit is contained in:
Forrest 2016-01-15 11:41:20 -08:00
commit b0c702b0df
2 changed files with 6 additions and 2 deletions

View file

@ -308,7 +308,7 @@ listen {{ listener.get('name', listener_name) }}
{%- endif %} {%- endif %}
{%- if 'servers' in listener %} {%- if 'servers' in listener %}
{%- for server_name, server in listener.servers|dictsort %} {%- for server_name, server in listener.servers|dictsort %}
server {{ server.get('name', server_name) }} {{ server.host }}:{{ server.port }} {{ server.check }} {{ server.get('extra', '') }} server {{ server.get('name', server_name) }} {{ server.host }}{% if 'port' in server %}:{{ server.port }}{% endif %} {{ server.get('check', '') }} {{ server.get('extra', '') }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{% endfor %} {% endfor %}
@ -502,7 +502,7 @@ backend {{ backend.get('name', backend_name) }}
{%- endif %} {%- endif %}
{%- if 'servers' in backend %} {%- if 'servers' in backend %}
{%- for server_name, server in backend.servers|dictsort %} {%- for server_name, server in backend.servers|dictsort %}
server {{ server.get('name', server_name) }} {{ server.host }}:{{ server.port }} {{ server.check }} {{ server.get('extra', '') }} server {{ server.get('name', server_name) }} {{ server.host }}{% if 'port' in server %}:{{ server.port }}{% endif %} {{ server.get('check', '') }} {{ server.get('extra', '') }}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}
{% endfor %} {% endfor %}

View file

@ -103,6 +103,8 @@ haproxy:
host: web2.example.com host: web2.example.com
port: 18888 port: 18888
check: check check: check
web3:
host: web3.example.com
frontends: frontends:
frontend1: frontend1:
@ -163,6 +165,8 @@ haproxy:
host: 123.156.189.111 host: 123.156.189.111
port: 8080 port: 8080
check: check check: check
another-server:
host: 123.156.189.112
api-backend: api-backend:
options: options:
- http-server-close - http-server-close