Saltstack Official Nginx 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.

25 line
694B

  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 %}