| 1 |
<% if $type == 'server' { -%> |
| 2 |
<%- zip(Array($ipaddresses.flatten), Array($server_names.flatten)).each |$values| { -%> |
| 3 |
<%- if $ports { -%> |
| 4 |
<%- Array($ports.flatten).each |$port| { -%> |
| 5 |
server <%= $values[1] %> <%= $values[0] %>:<%= $port %><% if $define_cookies { %><%= " cookie ${values[1]}" %><% } %> <% if $options { %><%= Array($options.flatten).sort.join(' ') %><% } %><% if $verifyhost == true { %> verifyhost <%= $values[1] %><% } %><% if $weight { %> weight <%= $weight %><% } %> |
| 6 |
<%- } -%> |
| 7 |
<%- } else { -%> |
| 8 |
server <%= $values[1] %> <%= $values[0] %><% if $define_cookies { %><%= " cookie ${values[1]}" %><% } %> <% if $options { %><%= Array($options.flatten).sort.join(' ') %><% } %><% if $verifyhost == true { %> verifyhost <%= $values[1] %><% } %><% if $weight { %> weight <%= $weight %><% } %> |
| 9 |
<%- } -%> |
| 10 |
<%- } -%> |
| 11 |
<% } elsif $type == 'server-template' { -%> |
| 12 |
server-template <%= $prefix %> <%= $amount %> <%= $fqdn %><% if $port { %><%= ":${port}" %><% }else { %><%= '' %><% } %><% if $define_cookies { %><%= " cookie ${fqdn}" %><% } %> <% if $options { %><%= Array($options.flatten).sort.join(' ') %><% } %><% if $verifyhost == true { %> verifyhost <%= $fqdn %><% } %><% if $weight { %> weight <%= $weight %><% } %> |
| 13 |
<% } elsif $type == 'default-server' { -%> |
| 14 |
default-server <% if $options { %><%= Array($options.flatten).sort.join(' ') %><% } %> |
| 15 |
<% } -%> |