Skip to content

Instantly share code, notes, and snippets.

@flupke
Created June 27, 2013 19:23
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 flupke/93b06fb75ff01efeb509 to your computer and use it in GitHub Desktop.
Save flupke/93b06fb75ff01efeb509 to your computer and use it in GitHub Desktop.
{% set vars = pillar['stashy']['server'] %}
{% for dir in vars['storage_dirs'] %}
{{ dir }}:
file.directory:
- user: {{ vars['user'] }}
- group: {{ vars['group'] }}
- makedirs: true
- require:
- user.present: {{ vars['user'] }}
{% endfor %}
python-virtualenv:
pkg.installed
supervisor:
pkg.installed
libevent-dev:
pkg.installed
stashy_virtualenv:
virtualenv.managed:
- name: {{ vars['venv_dir'] }}
- no_site_packages: True
- distribute: True
- runas: stupeflix
- require:
- pkg: python-virtualenv
stashy_package:
pip.installed:
- name: stashy==0.4
- user: {{ vars['user'] }}
- bin_env: {{ vars['venv_dir'] }}
- extra_index_url: {{ pillar['stupeflix_pypi'] }}
- require:
- virtualenv: stashy_virtualenv
/etc/stashy.conf.py:
file.managed:
- source: salt://stashy/server/stashy.conf.py
- template: jinja
/etc/supervisor/conf.d/stashy.conf:
file.managed:
- source: salt://stashy/server/supervisor.stashy.conf
- template: jinja
- require:
- pkg: supervisor
stashy:
supervisord.running:
- require:
- pkg: supervisor
- watch:
- file: /etc/stashy.conf.py
- file: /etc/supervisor/conf.d/stashy.conf
@flupke
Copy link
Author

flupke commented Jun 27, 2013

End of state.highstate output :

    State: - supervisord
    Name:      stashy
    Function:  running
        Result:    True
        Comment:   Not starting already running service: stashy
        Changes:   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment