2018-02-04 14:13:18 +01:00
|
|
|
#
|
|
|
|
# This file is managed by Salt! Do not edit by hand!
|
|
|
|
#
|
2016-02-01 17:03:47 +01:00
|
|
|
|
|
|
|
{% if salt['pillar.get']('apache:sites') is mapping %}
|
|
|
|
{%- set listen_directives = [] %}
|
|
|
|
{%- for id, site in salt['pillar.get']('apache:sites').items() %}
|
|
|
|
{%- set interfaces = site.get('interface', '*').split() %}
|
|
|
|
{%- set port = site.get('port', 80) %}
|
|
|
|
{%- for interface in interfaces %}
|
2018-10-10 11:04:13 +02:00
|
|
|
{%- if not site.get('exclude_listen_directive', False) and not port == '*' %}
|
2016-07-21 04:19:39 +02:00
|
|
|
{%- set listen_directive = interface ~ ':' ~ port %}
|
|
|
|
{%- if listen_directive not in listen_directives %}
|
|
|
|
{%- do listen_directives.append(listen_directive) %}
|
|
|
|
{%- endif %}
|
2016-02-01 17:03:47 +01:00
|
|
|
{%- endif %}
|
|
|
|
{%- endfor %}
|
|
|
|
{%- endfor %}
|
|
|
|
{%- for listen in listen_directives %}
|
|
|
|
Listen {{ listen }}
|
|
|
|
{%- endfor %}
|
|
|
|
{%- else %}
|
|
|
|
Listen 80
|
|
|
|
|
|
|
|
<IfModule mod_ssl.c>
|
|
|
|
Listen 443
|
|
|
|
</IfModule>
|
|
|
|
|
|
|
|
<IfModule mod_gnutls.c>
|
|
|
|
Listen 443
|
|
|
|
</IfModule>
|
|
|
|
{%- endif %}
|
2016-04-14 11:26:24 +02:00
|
|
|
|
|
|
|
{%- if salt['pillar.get']('apache:name_virtual_hosts') is iterable %}
|
|
|
|
{%- set name_virtual_host_directives = [] %}
|
|
|
|
|
|
|
|
{%- for name_virtual_host in salt['pillar.get']('apache:name_virtual_hosts') %}
|
|
|
|
{%- set interface = name_virtual_host.get('interface', '*') %}
|
|
|
|
{%- set port = name_virtual_host.get('port', 80) %}
|
|
|
|
{%- set name_virtual_host_directive = interface ~ ':' ~ port %}
|
|
|
|
{%- do name_virtual_host_directives.append(name_virtual_host_directive) %}
|
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
{%- for name_virtual_host in name_virtual_host_directives %}
|
|
|
|
NameVirtualHost {{ name_virtual_host }}
|
|
|
|
{%- endfor %}
|
|
|
|
{%- endif -%}
|