Skip to content

Instantly share code, notes, and snippets.

@silenius
Created May 27, 2016 08:38
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 silenius/e6a4025ee0427b2b25a3f28127cf198c to your computer and use it in GitHub Desktop.
Save silenius/e6a4025ee0427b2b25a3f28127cf198c to your computer and use it in GitHub Desktop.
jcigar@dev:/usr/local/etc/salt/states/webapps/ > more harmonia.sls
{% set cfg = salt['bbpf_webapp.config']('harmonia') %}
{% include 'webapps/_template.sls' %}
(MORE LINES COME HERE)
jcigar@dev:/usr/local/etc/salt/states/webapps/ > more _template.sls
include:
- venvs.webapps.{{ cfg.venv.name }}
(MORE LINES COME HERE)
jcigar@dev:/usr/local/etc/salt/states/webapps/ > more ../venvs/webapps/harmonia.sls
{% set venv = "harmonia" %}
{% include "venvs/webapps/_template.sls" %}
(MORE LINES COME HERE)
jcigar@dev:/usr/local/etc/salt/states/webapps/ > more ../venvs/webapps/_template.sls
{% set cfg = salt['bbpf_webapp.venv'](venv) %}
include:
- users.webapps.{{ cfg.user }}
# Install the virtualenv
{{ venv }}_venv:
virtualenv.managed:
- name: {{ cfg.full_path }}
- venv_bin: {{ cfg.venv_builder }}
- system_site_packages: False
- user: {{ cfg.user }}
- clear: False
- require:
- file: {{ cfg.full_path }}
- user: {{ cfg.user }}
- pkg: {{ salt['pillar.get']('postgresql:lookup:pkg_client') }}
{% if cfg.python_version == 3.4 %}
- pkg: python34
{% elif cfg.python_version == 2.7 %}
- pkg: python27
- pkg: py27-virtualenv
{% endif %}
(MORE LINES COME HERE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment