nginx: pkg: - installed service.running: - enable: True - require: - pkg: nginx nginx-common: pkg.installed /etc/nginx/nginx.conf: file.managed: - source: salt://base/nginx.conf - user: root - group: root - mode: 0644 - require: - pkg: nginx-common - watch_in: - service: nginx {% set nginx_ssl_keydir = salt['pillar.get']('nginx:sslkeydir', '/etc/nginx/ssl/private') %} {% set nginx_ssl_certdir = salt['pillar.get']('nginx:sslcertdir', '/etc/nginx/ssl/certs') %} {{ nginx_ssl_certdir }}: file.directory: - user: root - group: root - mode: 0755 - makedirs: True {{ nginx_ssl_keydir }}: file.directory: - user: root - group: root - mode: 0750 - makedirs: True