Saltstack Official Nginx Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

certificates.sls 694B

123456789101112131415161718192021222324
  1. include:
  2. - nginx.ng.service
  3. {%- for domain in salt['pillar.get']('nginx:ng:certificates', {}).keys() %}
  4. nginx_{{ domain }}_ssl_certificate:
  5. file.managed:
  6. - name: /etc/nginx/ssl/{{ domain }}.crt
  7. - makedirs: True
  8. - contents_pillar: nginx:ng:certificates:{{ domain }}:public_cert
  9. - watch_in:
  10. - service: nginx_service
  11. {% if salt['pillar.get']("nginx:ng:certificates:{}:private_key".format(domain)) %}
  12. nginx_{{ domain }}_ssl_key:
  13. file.managed:
  14. - name: /etc/nginx/ssl/{{ domain }}.key
  15. - mode: 600
  16. - makedirs: True
  17. - contents_pillar: nginx:ng:certificates:{{ domain }}:private_key
  18. - watch_in:
  19. - service: nginx_service
  20. {% endif %}
  21. {%- endfor %}