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.

96 lines
2.2KB

  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/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.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 %}
  64. {% if grains['os_family']=="FreeBSD" %}
  65. /usr/local/etc/{{ apache.service }}/envvars.d/by_salt.env:
  66. file.managed:
  67. - template: jinja
  68. - source:
  69. - salt://apache/files/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.jinja
  70. - require:
  71. - pkg: apache
  72. - watch_in:
  73. - service: apache
  74. {{ apache.portsfile }}:
  75. file.managed:
  76. - template: jinja
  77. - source:
  78. - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
  79. - require:
  80. - pkg: apache
  81. - watch_in:
  82. - service: apache
  83. - context:
  84. apache: {{ apache }}
  85. {% endif %}