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.

49 lines
1.2KB

  1. {% from "apache/map.jinja" import apache with context %}
  2. apache:
  3. pkg.installed:
  4. - name: {{ apache.server }}
  5. group.present:
  6. - name: {{ apache.group }}
  7. - system: True
  8. user.present:
  9. - name: {{ apache.user }}
  10. - gid: {{ apache.group }}
  11. - system: True
  12. {# By default run apache service states (unless pillar is false) #}
  13. {% if salt['pillar.get']('apache:manage_service_states', True) %}
  14. service.running:
  15. - name: {{ apache.service }}
  16. - enable: True
  17. - require:
  18. - module: apache-restart
  19. - module: apache-reload
  20. # The following states are inert by default and can be used by other states to
  21. # trigger a restart or reload as needed.
  22. apache-reload:
  23. module.wait:
  24. - name: service.reload
  25. - m_name: {{ apache.service }}
  26. - require:
  27. - module: apache-restart
  28. apache-restart:
  29. module.wait:
  30. - name: service.restart
  31. - m_name: {{ apache.service }}
  32. {% else %}
  33. apache-reload:
  34. test.show_notification:
  35. - name: Skipping reload per user request
  36. - text: Pillar manage_service_states is False
  37. apache-restart:
  38. test.show_notification:
  39. - name: Skipping restart per user request
  40. - text: Pillar manage_service_states is False
  41. {% endif %}