Skip to content

Instantly share code, notes, and snippets.

@ryan-lane
Created August 13, 2014 00:51
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 ryan-lane/6d131eff9983f514e809 to your computer and use it in GitHub Desktop.
Save ryan-lane/6d131eff9983f514e809 to your computer and use it in GitHub Desktop.
Ensure salt virtualenv exists:
virtualenv.managed:
- name: /srv/salt/venv
# Switch to the existing salt venv
- pip_exists_action: s
- system_site_packages: True
- requirements: /my/requirements.txt
Ensure modules and grains are refreshed if salt venv changes:
module.wait:
- name: saltutil.refresh_modules
# This needs to happen immediately, so we use watch, rather than listen.
- watch:
- virtualenv: Ensure salt virtualenv exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment