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.

config.sls 2.2KB

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