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.

41 lines
1.1KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {%- set tplroot = tpldir.split('/')[0] %}
  4. {%- from tplroot ~ "/map.jinja" import apache with context %}
  5. {%- if 'deps' in apache.pkg and apache.pkg.deps and apache.pkg.deps is iterable and apache.pkg.deps is not string %}
  6. apache-package-install-deps-pkg-installed:
  7. pkg.installed:
  8. - names: {{ apache.pkg.deps|json }}
  9. - require:
  10. - apache-package-install-pkg-installed
  11. {%- if grains.os_family == 'Debian' %}
  12. cmd.run:
  13. # because pkg.installed returns error during dpkg postinstall
  14. - name: apt install libapache2-mod-security2 || true
  15. {%- endif %}
  16. {%- endif %}
  17. apache-package-install-pkg-installed:
  18. {%- if grains.os_family == 'Windows' %}
  19. service.dead:
  20. - name: {{ apache.service.name }} # port 8080
  21. chocolatey.installed:
  22. - name: {{ apache.pkg.name }}
  23. - force: True
  24. {%- else %}
  25. pkg.installed:
  26. - name: {{ apache.pkg.name }}
  27. group.present:
  28. - name: {{ apache.group }}
  29. - system: True
  30. user.present:
  31. - name: {{ apache.user }}
  32. - gid: {{ apache.group }}
  33. - system: True
  34. {%- endif %}