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.

mod_ssl.sls 2.0KB

7 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. {% elif grains['os_family']=="FreeBSD" %}
  30. include:
  31. - apache
  32. - apache.mod_socache_shmcb
  33. {{ apache.modulesdir }}/010_mod_ssl.conf:
  34. file.managed:
  35. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_ssl.conf.jinja
  36. - mode: 644
  37. - template: jinja
  38. - require:
  39. - pkg: apache
  40. - watch_in:
  41. - module: apache-restart
  42. {% endif %}
  43. {{ apache.confdir }}/tls-defaults.conf:
  44. {% if salt['pillar.get']('apache:mod_ssl:manage_tls_defaults', False) %}
  45. file.managed:
  46. - source: salt://apache/files/tls-defaults.conf.jinja
  47. - mode: 644
  48. - template: jinja
  49. {% else %}
  50. file.absent:
  51. {% endif %}
  52. - require:
  53. - pkg: apache
  54. - watch_in:
  55. - module: apache-restart
  56. {% if grains['os_family']=="Debian" %}
  57. a2endisconf tls-defaults:
  58. cmd.run:
  59. {% if salt['pillar.get']('apache:mod_ssl:manage_tls_defaults', False) %}
  60. - name: a2enconf tls-defaults
  61. - unless: test -L /etc/apache2/conf-enabled/tls-defaults.conf
  62. {% else %}
  63. - name: a2disconf tls-defaults
  64. - onlyif: test -L /etc/apache2/conf-enabled/tls-defaults.conf
  65. {% endif %}
  66. - order: 225
  67. - require:
  68. - pkg: apache
  69. - file: {{ apache.confdir }}/tls-defaults.conf
  70. - watch_in:
  71. - module: apache-restart
  72. {% endif %}