Skip to content

Instantly share code, notes, and snippets.

@whytewolf
Last active December 8, 2016 20:17
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 whytewolf/d519a4b473dea21e6f122166394a00de to your computer and use it in GitHub Desktop.
Save whytewolf/d519a4b473dea21e6f122166394a00de to your computer and use it in GitHub Desktop.
{% if salt.grains.get('id') in salt.pillar.get('nginx:apps',{}) %}
{% set app = salt.grains.get('id') %}
{% else %}
{% set app = 'default' %}
{% endif %}
/etc/nginx/sites-available/{{ app }}:
file.managed:
- source: salt://nginx/files/etc/nginx/sites-available/{{ app }}.jinja
- template: jinja
- user: root
- group: root
- mode: 640
/etc/nginx/sites-enabled/{{ app }}:
file.symlink:
- target: /etc/nginx/sites-available/{{ app }}
- require:
- file: /etc/nginx/sites-available/{{ app }}
nginx:
apps:
- gb-api
- other-app
- second
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment