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

72 行
1.5KB

  1. {% from "apache/map.jinja" import apache with context %}
  2. include:
  3. - apache
  4. {{ apache.configfile }}:
  5. file.managed:
  6. - template: jinja
  7. - source:
  8. - salt://apache/files/{{ salt['grains.get']('os_family') }}/apache-{{ apache.version }}.config.jinja
  9. - require:
  10. - pkg: apache
  11. - watch_in:
  12. - service: apache
  13. - context:
  14. apache: {{ apache }}
  15. {{ apache.vhostdir }}:
  16. file.directory:
  17. - require:
  18. - pkg: apache
  19. - watch_in:
  20. - service: apache
  21. {% if grains['os_family']=="Debian" %}
  22. /etc/apache2/envvars:
  23. file.managed:
  24. - template: jinja
  25. - source:
  26. - salt://apache/files/Debian/envvars.jinja
  27. - require:
  28. - pkg: apache
  29. - watch_in:
  30. - service: apache
  31. {{ apache.portsfile }}:
  32. file.managed:
  33. - template: jinja
  34. - source:
  35. - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
  36. - require:
  37. - pkg: apache
  38. - watch_in:
  39. - service: apache
  40. - context:
  41. apache: {{ apache }}
  42. {% endif %}
  43. {% if grains['os_family']=="RedHat" %}
  44. /etc/httpd/conf.d/welcome.conf:
  45. file.absent:
  46. - require:
  47. - pkg: apache
  48. - watch_in:
  49. - service: apache
  50. {% endif %}
  51. {% if grains['os_family']=="Suse" %}
  52. /etc/apache2/sysconfig.d/global.conf:
  53. file.managed:
  54. - template: jinja
  55. - source:
  56. - salt://apache/files/{{ salt['grains.get']('os_family') }}/global.config.jinja
  57. - require:
  58. - pkg: apache
  59. - watch_in:
  60. - service: apache
  61. - context:
  62. apache: {{ apache }}
  63. {% endif %}