-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyenv.sls
46 lines (44 loc) · 1.05 KB
/
pyenv.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{% from 'users/macros.sls' import gethomedir %}
include:
- users
python_build_dependencies:
pkg.installed:
- pkgs:
# https://github.com/pyenv/pyenv/wiki/common-build-problems
- build-essential
- curl
- git
- libbz2-dev
- libffi-dev
- liblzma-dev
- libncurses5-dev
- libncursesw5-dev
- libreadline-dev
- libsqlite3-dev
- libssl-dev
- llvm
- make
- python-openssl
- tk-dev
- wget
- xz-utils
- zlib1g-dev
{% for user, p in pillar.get('users', {}).items() %}
{% if p.get('pyenv') %}
{% set home = gethomedir(user) %}
pyenv_for_{{ user }}:
git.latest:
- name: https://github.com/yyuu/pyenv.git
- target: {{ home }}/.pyenv
- user: {{ user }}
- require:
- user: user_{{ user }}
pyenv_virtualenv_for_{{ user }}:
git.latest:
- name: https://github.com/yyuu/pyenv-virtualenv.git
- target: {{ home }}/.pyenv/plugins/pyenv-virtualenv
- user: {{ user }}
- require:
- user: user_{{ user }}
{% endif %}
{% endfor %}