Saltstack Official Apache Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

35 行
902B

  1. {% from "apache/map.jinja" import apache with context %}
  2. include:
  3. - apache
  4. {% for id, site in salt['pillar.get']('apache:sites', {}).items() %}
  5. {{ id }}:
  6. file:
  7. - managed
  8. - name: {{ apache.vhostdir }}/{{ id }}{{ apache.confext }}
  9. - source: {{ site.get('template_file', 'salt://apache/vhosts/standard.tmpl') }}
  10. - template: {{ site.get('template_engine', 'jinja') }}
  11. - context:
  12. id: {{ id|json }}
  13. site: {{ site|json }}
  14. map: {{ apache|json }}
  15. - require:
  16. - pkg: apache
  17. - watch_in:
  18. - module: apache-reload
  19. {% if grains.os_family == 'Debian' %}
  20. a2ensite {{ id }}{{ apache.confext }}:
  21. cmd:
  22. - run
  23. - unless: test -f /etc/apache2/sites-enabled/{{ id }}{{ apache.confext }}
  24. - require:
  25. - file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}
  26. - watch_in:
  27. - module: apache-reload
  28. {% endif %}
  29. {% endfor %}