2015-06-23 21:17:52 +02:00
|
|
|
include:
|
|
|
|
- nginx.ng.service
|
|
|
|
|
|
|
|
{%- for domain in salt['pillar.get']('nginx:ng:certificates', {}).keys() %}
|
|
|
|
|
|
|
|
nginx_{{ domain }}_ssl_certificate:
|
|
|
|
file.managed:
|
|
|
|
- name: /etc/nginx/ssl/{{ domain }}.crt
|
|
|
|
- makedirs: True
|
|
|
|
- contents_pillar: nginx:ng:certificates:{{ domain }}:public_cert
|
|
|
|
- watch_in:
|
|
|
|
- service: nginx_service
|
|
|
|
|
2016-10-12 10:52:17 +02:00
|
|
|
{% if salt['pillar.get']("nginx:ng:certificates:{}:private_key".format(domain)) %}
|
2015-06-23 21:17:52 +02:00
|
|
|
nginx_{{ domain }}_ssl_key:
|
|
|
|
file.managed:
|
|
|
|
- name: /etc/nginx/ssl/{{ domain }}.key
|
|
|
|
- mode: 600
|
|
|
|
- makedirs: True
|
|
|
|
- contents_pillar: nginx:ng:certificates:{{ domain }}:private_key
|
|
|
|
- watch_in:
|
|
|
|
- service: nginx_service
|
2016-10-12 10:52:17 +02:00
|
|
|
{% endif %}
|
2015-06-23 21:17:52 +02:00
|
|
|
{%- endfor %}
|