Skip to content

Instantly share code, notes, and snippets.

@pduersteler
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pduersteler/4d2693e3e1abecdec54c to your computer and use it in GitHub Desktop.
Save pduersteler/4d2693e3e1abecdec54c to your computer and use it in GitHub Desktop.
# /srv/pillar/nginx.sls
nginx:
vhosts:
foo:
server_names:
- example.com
- www.example.com
# /src/salt/nginx/vhosts.sls
{% for vhost, settings in pillar.get('nginx:vhosts', {}).items() %}
/etc/nginx/sites-available/{{vhost}}.conf:
file.managed:
- source: salt://nginx/files/vhost_template.conf
- template: jinja
{% endfor %}
$ salt-call pillar.items nginx
local:
----------
foo:
----------
server_names:
- example.com
- www.example.com
$ salt minion state.sls nginx.vhosts
minion:
Summary
-----------
Succeeded: 0
Failed: 0
-----------
Total: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment