Saltstack Official Apache Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

141 lines
3.4KB

  1. {% from "apache/map.jinja" import apache with context %}
  2. include:
  3. - apache
  4. {{ apache.logdir }}:
  5. file.directory:
  6. - makedirs: True
  7. - require:
  8. - pkg: apache
  9. - watch_in:
  10. - module: apache-restart
  11. - require_in:
  12. - module: apache-restart
  13. - module: apache-reload
  14. - service: apache
  15. {{ apache.configfile }}:
  16. file.managed:
  17. - template: jinja
  18. - source:
  19. - salt://apache/files/{{ salt['grains.get']('os_family') }}/apache-{{ apache.version }}.config.jinja
  20. - require:
  21. - pkg: apache
  22. - watch_in:
  23. - module: apache-restart
  24. - require_in:
  25. - module: apache-restart
  26. - module: apache-reload
  27. - service: apache
  28. - context:
  29. apache: {{ apache | json }}
  30. {{ apache.vhostdir }}:
  31. file.directory:
  32. - makedirs: True
  33. - require:
  34. - pkg: apache
  35. - watch_in:
  36. - module: apache-restart
  37. - require_in:
  38. - module: apache-restart
  39. - module: apache-reload
  40. - service: apache
  41. {% if grains['os_family']=="Debian" %}
  42. /etc/apache2/envvars:
  43. file.managed:
  44. - template: jinja
  45. - source:
  46. - salt://apache/files/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.jinja
  47. - require:
  48. - pkg: apache
  49. - watch_in:
  50. - module: apache-restart
  51. - require_in:
  52. - module: apache-restart
  53. - module: apache-reload
  54. - service: apache
  55. {{ apache.portsfile }}:
  56. file.managed:
  57. - template: jinja
  58. - source:
  59. - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
  60. - require:
  61. - pkg: apache
  62. - watch_in:
  63. - module: apache-restart
  64. - require_in:
  65. - module: apache-restart
  66. - module: apache-reload
  67. - service: apache
  68. - context:
  69. apache: {{ apache | json }}
  70. {% endif %}
  71. {% if grains['os_family']=="RedHat" %}
  72. {{ apache.confdir }}/welcome.conf:
  73. file.absent:
  74. - require:
  75. - pkg: apache
  76. - watch_in:
  77. - module: apache-restart
  78. - require_in:
  79. - module: apache-restart
  80. - module: apache-reload
  81. - service: apache
  82. {% endif %}
  83. {% if grains['os_family']=="Suse" or salt['grains.get']('os') == 'SUSE' %}
  84. /etc/apache2/global.conf:
  85. file.managed:
  86. - template: jinja
  87. - source:
  88. - salt://apache/files/{{ salt['grains.get']('os_family') }}/global.config.jinja
  89. - require:
  90. - pkg: apache
  91. - watch_in:
  92. - module: apache-restart
  93. - require_in:
  94. - module: apache-restart
  95. - module: apache-reload
  96. - service: apache
  97. - context:
  98. apache: {{ apache | json }}
  99. {% endif %}
  100. {% if grains['os_family']=="FreeBSD" %}
  101. /usr/local/etc/{{ apache.service }}/envvars.d/by_salt.env:
  102. file.managed:
  103. - template: jinja
  104. - source:
  105. - salt://apache/files/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.jinja
  106. - require:
  107. - pkg: apache
  108. - watch_in:
  109. - module: apache-restart
  110. - require_in:
  111. - module: apache-restart
  112. - module: apache-reload
  113. - service: apache
  114. {{ apache.portsfile }}:
  115. file.managed:
  116. - template: jinja
  117. - source:
  118. - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
  119. - require:
  120. - pkg: apache
  121. - watch_in:
  122. - module: apache-restart
  123. - require_in:
  124. - module: apache-restart
  125. - module: apache-reload
  126. - service: apache
  127. - context:
  128. apache: {{ apache | json }}
  129. {% endif %}