Saltstack Official Nginx Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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