Saltstack Official Apache Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

68 lines
1.4KB

  1. {% if grains['os_family']=="Debian" %}
  2. include:
  3. - apache
  4. a2enmod remoteip:
  5. cmd.run:
  6. - unless: ls /etc/apache2/mods-enabled/remoteip.load
  7. - order: 255
  8. - require:
  9. - pkg: apache
  10. - watch_in:
  11. - module: apache-restart
  12. - require_in:
  13. - module: apache-restart
  14. - module: apache-reload
  15. - service: apache
  16. a2enconf remoteip:
  17. cmd.run:
  18. - unless: ls /etc/apache2/conf-enabled/remoteip.conf
  19. - order: 255
  20. - require:
  21. - pkg: apache
  22. - watch_in:
  23. - module: apache-reload
  24. - require_in:
  25. - module: apache-restart
  26. - module: apache-reload
  27. - service: apache
  28. /etc/apache2/conf-available/remoteip.conf:
  29. file.managed:
  30. - template: jinja
  31. - source:
  32. - salt://apache/files/{{ salt['grains.get']('os_family') }}/conf-available/remoteip.conf.jinja
  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. {% endif %}
  42. {% if grains['os_family']=="RedHat" %}
  43. include:
  44. - apache
  45. /etc/httpd/conf.d/remoteip.conf:
  46. file.managed:
  47. - template: jinja
  48. - source:
  49. - salt://apache/files/{{ salt['grains.get']('os_family') }}/conf.modules.d/remoteip.conf.jinja
  50. - require:
  51. - pkg: apache
  52. - watch_in:
  53. - module: apache-restart
  54. - require_in:
  55. - module: apache-restart
  56. - module: apache-reload
  57. - service: apache
  58. {% endif %}