Saltstack Official Apache Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

mod_remoteip.sls 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. a2enconf remoteip:
  13. cmd.run:
  14. - unless: ls /etc/apache2/conf-enabled/remoteip.conf
  15. - order: 255
  16. - require:
  17. - pkg: apache
  18. - watch_in:
  19. - module: apache-reload
  20. /etc/apache2/conf-available/remoteip.conf:
  21. file.managed:
  22. - template: jinja
  23. - source:
  24. - salt://apache/files/{{ salt['grains.get']('os_family') }}/conf-available/remoteip.conf.jinja
  25. - require:
  26. - pkg: apache
  27. - watch_in:
  28. - service: apache
  29. {% endif %}
  30. {% if grains['os_family']=="RedHat" %}
  31. include:
  32. - apache
  33. /etc/httpd/conf.d/remoteip.conf:
  34. file.managed:
  35. - template: jinja
  36. - source:
  37. - salt://apache/files/{{ salt['grains.get']('os_family') }}/remoteip.conf.jinja
  38. - require:
  39. - pkg: apache
  40. - watch_in:
  41. - service: apache
  42. {% endif %}