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.

105 satır
2.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. - service: apache
  11. {{ apache.configfile }}:
  12. file.managed:
  13. - template: jinja
  14. - source:
  15. - salt://apache/files/{{ salt['grains.get']('os_family') }}/apache-{{ apache.version }}.config.jinja
  16. - require:
  17. - pkg: apache
  18. - watch_in:
  19. - service: apache
  20. - context:
  21. apache: {{ apache }}
  22. {{ apache.vhostdir }}:
  23. file.directory:
  24. - makedirs: True
  25. - require:
  26. - pkg: apache
  27. - watch_in:
  28. - service: apache
  29. {% if grains['os_family']=="Debian" %}
  30. /etc/apache2/envvars:
  31. file.managed:
  32. - template: jinja
  33. - source:
  34. - salt://apache/files/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.jinja
  35. - require:
  36. - pkg: apache
  37. - watch_in:
  38. - service: apache
  39. {{ apache.portsfile }}:
  40. file.managed:
  41. - template: jinja
  42. - source:
  43. - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
  44. - require:
  45. - pkg: apache
  46. - watch_in:
  47. - service: apache
  48. - context:
  49. apache: {{ apache }}
  50. {% endif %}
  51. {% if grains['os_family']=="RedHat" %}
  52. /etc/httpd/conf.d/welcome.conf:
  53. file.absent:
  54. - require:
  55. - pkg: apache
  56. - watch_in:
  57. - service: apache
  58. {% endif %}
  59. {% if grains['os_family']=="Suse" or salt['grains.get']('os') == 'SUSE' %}
  60. /etc/apache2/global.conf:
  61. file.managed:
  62. - template: jinja
  63. - source:
  64. - salt://apache/files/{{ salt['grains.get']('os_family') }}/global.config.jinja
  65. - require:
  66. - pkg: apache
  67. - watch_in:
  68. - service: apache
  69. - context:
  70. apache: {{ apache }}
  71. {% endif %}
  72. {% if grains['os_family']=="FreeBSD" %}
  73. /usr/local/etc/{{ apache.service }}/envvars.d/by_salt.env:
  74. file.managed:
  75. - template: jinja
  76. - source:
  77. - salt://apache/files/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.jinja
  78. - require:
  79. - pkg: apache
  80. - watch_in:
  81. - service: apache
  82. {{ apache.portsfile }}:
  83. file.managed:
  84. - template: jinja
  85. - source:
  86. - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
  87. - require:
  88. - pkg: apache
  89. - watch_in:
  90. - service: apache
  91. - context:
  92. apache: {{ apache }}
  93. {% endif %}