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

12345678910111213141516171819202122232425262728
  1. {% if grains['os_family']=="Debian" %}
  2. include:
  3. - apache
  4. {% for module in salt['pillar.get']('apache:modules:enabled', []) %}
  5. a2enmod {{ module }}:
  6. cmd.run:
  7. - unless: ls /etc/apache2/mods-enabled/{{ module }}.load
  8. - order: 225
  9. - require:
  10. - pkg: apache
  11. - watch_in:
  12. - module: apache-restart
  13. {% endfor %}
  14. {% for module in salt['pillar.get']('apache:modules:disabled', []) %}
  15. a2dismod {{ module }}:
  16. cmd.run:
  17. - onlyif: ls /etc/apache2/mods-enabled/{{ module }}.load
  18. - order: 225
  19. - require:
  20. - pkg: apache
  21. - watch_in:
  22. - module: apache-restart
  23. {% endfor %}
  24. {% endif %}