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.

52 lines
1.5KB

  1. {% from "apache/map.jinja" import apache with context %}
  2. include:
  3. - apache
  4. {%- for site, confcert in salt['pillar.get']('apache:sites', {}).iteritems() %}
  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. {% endif %}
  18. {% if confcert.SSLCertificateFile is defined and confcert.SSLCertificateFile_content is defined %}
  19. # Deploy {{ site }} cert file
  20. apache_cert_config_{{ site }}_cert_file:
  21. file.managed:
  22. - name: {{ confcert.SSLCertificateFile }}
  23. - contents_pillar: apache:sites:{{ site }}:SSLCertificateFile_content
  24. - makedirs: True
  25. - mode: 600
  26. - user: root
  27. - group: root
  28. - watch_in:
  29. - module: apache-reload
  30. {% endif %}
  31. {% if confcert.SSLCertificateChainFile is defined and confcert.SSLCertificateChainFile_content is defined %}
  32. # Deploy {{ site }} bundle file
  33. apache_cert_config_{{ site }}_bundle_file:
  34. file.managed:
  35. - name: {{ confcert.SSLCertificateChainFile }}
  36. - contents_pillar: apache:sites:{{ site }}:SSLCertificateChainFile_content
  37. - makedirs: True
  38. - mode: 600
  39. - user: root
  40. - group: root
  41. - watch_in:
  42. - module: apache-reload
  43. {% endif %}
  44. {%- endfor %}