Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ports-2.4.conf.jinja 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #
  2. # This file is managed by Salt! Do not edit by hand!
  3. #
  4. {% if salt['pillar.get']('apache:sites') is mapping %}
  5. {%- set listen_directives = [] %}
  6. {%- for id, site in salt['pillar.get']('apache:sites').items() %}
  7. {%- set interfaces = site.get('interface', '*').split() %}
  8. {%- set port = site.get('port', 80) %}
  9. {%- for interface in interfaces %}
  10. {%- if not site.get('exclude_listen_directive', False) and not port == '*' %}
  11. {%- set listen_directive = interface ~ ':' ~ port %}
  12. {%- if listen_directive not in listen_directives %}
  13. {%- do listen_directives.append(listen_directive) %}
  14. {%- endif %}
  15. {%- endif %}
  16. {%- endfor %}
  17. {%- endfor %}
  18. {%- for listen in listen_directives %}
  19. Listen {{ listen }}
  20. {%- endfor %}
  21. {%- else %}
  22. Listen 80
  23. <IfModule mod_ssl.c>
  24. Listen 443
  25. </IfModule>
  26. <IfModule mod_gnutls.c>
  27. Listen 443
  28. </IfModule>
  29. {%- endif %}
  30. {%- if salt['pillar.get']('apache:name_virtual_hosts') is iterable %}
  31. {%- set name_virtual_host_directives = [] %}
  32. {%- for name_virtual_host in salt['pillar.get']('apache:name_virtual_hosts') %}
  33. {%- set interface = name_virtual_host.get('interface', '*') %}
  34. {%- set port = name_virtual_host.get('port', 80) %}
  35. {%- set name_virtual_host_directive = interface ~ ':' ~ port %}
  36. {%- do name_virtual_host_directives.append(name_virtual_host_directive) %}
  37. {%- endfor %}
  38. {%- for name_virtual_host in name_virtual_host_directives %}
  39. NameVirtualHost {{ name_virtual_host }}
  40. {%- endfor %}
  41. {%- endif -%}