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.

92 lines
2.1KB

  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. /etc/apache2/mods-available/ssl.conf:
  15. file.managed:
  16. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/ssl.conf.jinja
  17. - template: jinja
  18. - mode: 644
  19. - watch_in:
  20. - module: apache-restart
  21. {% elif grains['os_family']=="RedHat" %}
  22. mod_ssl:
  23. pkg.installed:
  24. - name: {{ apache.mod_ssl }}
  25. - require:
  26. - pkg: apache
  27. - watch_in:
  28. - module: apache-restart
  29. {{ apache.confdir }}/ssl.conf:
  30. file.absent:
  31. - require:
  32. - pkg: apache
  33. - watch_in:
  34. - service: apache
  35. {% elif grains['os_family']=="FreeBSD" %}
  36. include:
  37. - apache
  38. - apache.mod_socache_shmcb
  39. {{ apache.modulesdir }}/010_mod_ssl.conf:
  40. file.managed:
  41. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_ssl.conf.jinja
  42. - mode: 644
  43. - template: jinja
  44. - require:
  45. - pkg: apache
  46. - watch_in:
  47. - module: apache-restart
  48. {% endif %}
  49. {{ apache.confdir }}/tls-defaults.conf:
  50. {% if salt['pillar.get']('apache:mod_ssl:manage_tls_defaults', False) %}
  51. file.managed:
  52. - source: salt://apache/files/tls-defaults.conf.jinja
  53. - mode: 644
  54. - template: jinja
  55. {% else %}
  56. file.absent:
  57. {% endif %}
  58. - require:
  59. - pkg: apache
  60. - watch_in:
  61. - module: apache-restart
  62. {% if grains['os_family']=="Debian" %}
  63. a2endisconf tls-defaults:
  64. cmd.run:
  65. {% if salt['pillar.get']('apache:mod_ssl:manage_tls_defaults', False) %}
  66. - name: a2enconf tls-defaults
  67. - unless: test -L /etc/apache2/conf-enabled/tls-defaults.conf
  68. {% else %}
  69. - name: a2disconf tls-defaults
  70. - onlyif: test -L /etc/apache2/conf-enabled/tls-defaults.conf
  71. {% endif %}
  72. - order: 225
  73. - require:
  74. - pkg: apache
  75. - file: {{ apache.confdir }}/tls-defaults.conf
  76. - watch_in:
  77. - module: apache-restart
  78. {% endif %}