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.

преди 6 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {% from "apache/map.jinja" import apache with context %}
  2. include:
  3. - apache
  4. {%- for site, confcert in salt['pillar.get']('apache:sites', {}).items() %}
  5. {% if confcert.SSLCertificateKeyFile is defined and confcert.SSLCertificateKeyFile_content is defined %}
  6. # Deploy {{ site }} key file
  7. apache_cert_config_{{ site }}_key_file:
  8. file.managed:
  9. - name: {{ confcert.SSLCertificateKeyFile }}
  10. - contents_pillar: apache:sites:{{ site }}:SSLCertificateKeyFile_content
  11. - makedirs: True
  12. - mode: 600
  13. - user: root
  14. - group: root
  15. - watch_in:
  16. - module: apache-reload
  17. - require_in:
  18. - module: apache-restart
  19. - module: apache-reload
  20. - service: apache
  21. {% endif %}
  22. {% if confcert.SSLCertificateFile is defined and confcert.SSLCertificateFile_content is defined %}
  23. # Deploy {{ site }} cert file
  24. apache_cert_config_{{ site }}_cert_file:
  25. file.managed:
  26. - name: {{ confcert.SSLCertificateFile }}
  27. - contents_pillar: apache:sites:{{ site }}:SSLCertificateFile_content
  28. - makedirs: True
  29. - mode: 600
  30. - user: root
  31. - group: root
  32. - watch_in:
  33. - module: apache-reload
  34. - require_in:
  35. - module: apache-restart
  36. - module: apache-reload
  37. - service: apache
  38. {% endif %}
  39. {% if confcert.SSLCertificateChainFile is defined and confcert.SSLCertificateChainFile_content is defined %}
  40. # Deploy {{ site }} bundle file
  41. apache_cert_config_{{ site }}_bundle_file:
  42. file.managed:
  43. - name: {{ confcert.SSLCertificateChainFile }}
  44. - contents_pillar: apache:sites:{{ site }}:SSLCertificateChainFile_content
  45. - makedirs: True
  46. - mode: 600
  47. - user: root
  48. - group: root
  49. - watch_in:
  50. - module: apache-reload
  51. - require_in:
  52. - module: apache-restart
  53. - module: apache-reload
  54. - service: apache
  55. {% endif %}
  56. {%- endfor %}