Saltstack Official Apache Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

mod_ssl.sls 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {% from "apache/map.jinja" import apache with context %}
  2. {% if grains['os_family']=="Debian" %}
  3. include:
  4. - apache
  5. a2enmod mod_ssl:
  6. cmd.run:
  7. - name: a2enmod ssl
  8. - unless: ls /etc/apache2/mods-enabled/ssl.load
  9. - order: 225
  10. - require:
  11. - pkg: apache
  12. - watch_in:
  13. - module: apache-restart
  14. {% elif grains['os_family']=="RedHat" %}
  15. mod_ssl:
  16. pkg.installed:
  17. - name: {{ apache.mod_ssl }}
  18. - require:
  19. - pkg: apache
  20. - watch_in:
  21. - module: apache-restart
  22. {% elif grains['os_family']=="FreeBSD" %}
  23. include:
  24. - apache
  25. - apache.mod_socache_shmcb
  26. {{ apache.modulesdir }}/010_mod_ssl.conf:
  27. file.managed:
  28. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_ssl.conf.jinja
  29. - mode: 644
  30. - template: jinja
  31. - require:
  32. - pkg: apache
  33. - watch_in:
  34. - module: apache-restart
  35. {% endif %}
  36. {{ apache.confdir }}/tls-defaults.conf:
  37. {% if salt['pillar.get']('apache:mod_ssl:manage_tls_defaults', False) %}
  38. file.managed:
  39. - source: salt://apache/files/tls-defaults.conf.jinja
  40. - mode: 644
  41. - template: jinja
  42. {% else %}
  43. file.absent:
  44. {% endif %}
  45. - require:
  46. - pkg: apache
  47. - watch_in:
  48. - module: apache-restart
  49. {% if grains['os_family']=="Debian" %}
  50. a2endisconf tls-defaults:
  51. cmd.run:
  52. {% if salt['pillar.get']('apache:mod_ssl:manage_tls_defaults', False) %}
  53. - name: a2enconf tls-defaults
  54. - unless: test -L /etc/apache2/conf-enabled/tls-defaults.conf
  55. {% else %}
  56. - name: a2disconf tls-defaults
  57. - onlyif: test -L /etc/apache2/conf-enabled/tls-defaults.conf
  58. {% endif %}
  59. - order: 225
  60. - require:
  61. - pkg: apache
  62. - file: {{ apache.confdir }}/tls-defaults.conf
  63. - watch_in:
  64. - module: apache-restart
  65. {% endif %}