mirror of
https://github.com/unman/shaker.git
synced 2025-02-02 09:35:25 -05:00
pyenv - setup
This commit is contained in:
parent
e3c72c0e38
commit
d0071c82e5
63
pyenv/install.sls
Normal file
63
pyenv/install.sls
Normal file
@ -0,0 +1,63 @@
|
||||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
{% if grains['nodename'] != 'dom0' %}
|
||||
|
||||
{% if salt['qvm.exists']('cacher') %}
|
||||
{% if grains['os_family']|lower == 'debian' %}
|
||||
{% if grains['nodename']|lower != 'host' %}
|
||||
{% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*list') %}
|
||||
{{ repo }}_baseurl:
|
||||
file.replace:
|
||||
- name: {{ repo }}
|
||||
- pattern: 'https://'
|
||||
- repl: 'http://HTTPS///'
|
||||
- flags: [ 'IGNORECASE', 'MULTILINE' ]
|
||||
- backup: False
|
||||
|
||||
{% endfor %}
|
||||
|
||||
/etc/apt/sources.list:
|
||||
file.replace:
|
||||
- name: /etc/apt/sources.list
|
||||
- pattern: 'https:'
|
||||
- repl: 'http://HTTPS/'
|
||||
- flags: [ 'IGNORECASE', 'MULTILINE' ]
|
||||
- backup: False
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
pyenv_update:
|
||||
pkg.uptodate:
|
||||
- refresh: True
|
||||
|
||||
pyenv_install:
|
||||
pkg.installed:
|
||||
- pkgs:
|
||||
- qubes-core-agent-networking
|
||||
- build-essential
|
||||
- curl
|
||||
- git
|
||||
- libbz2-dev
|
||||
- libcurl4-openssl-dev
|
||||
- libffi-dev
|
||||
- libncursesw5-dev
|
||||
- libreadline-dev
|
||||
- libsqlite3-dev
|
||||
- libssl-dev
|
||||
- libxml2-dev
|
||||
- libxmlsec1-dev
|
||||
- liblzma-dev
|
||||
- llvm
|
||||
- make
|
||||
- tk-dev
|
||||
- wget
|
||||
- xz-utils
|
||||
- zlib1g-dev
|
||||
|
||||
|
||||
{% endif %}
|
5
pyenv/install.top
Normal file
5
pyenv/install.top
Normal file
@ -0,0 +1,5 @@
|
||||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
|
||||
|
||||
base:
|
||||
'*':
|
||||
- pyenv.install
|
8
pyenv/setup.sh
Normal file
8
pyenv/setup.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> /home/user/.bashrc
|
||||
echo 'export PYENV_ROOT=/home/user/.pyenv' >> /home/user/.bashrc
|
||||
echo 'command -v pyenv >/dev/null|| export PATH="$HOME/.pyenv/bin:$PATH" '>> /home/user/.bashrc
|
||||
echo 'eval "$(pyenv init -)" '>> /home/user/.bashrc
|
||||
echo 'eval "$(pyenv virtualenv-init -)" '>> /home/user/.bashrc
|
||||
|
||||
|
30
pyenv/setup_pyenv.sls
Normal file
30
pyenv/setup_pyenv.sls
Normal file
@ -0,0 +1,30 @@
|
||||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
{% if grains['nodename'] != 'dom0' %}
|
||||
|
||||
pyenv_cloned:
|
||||
git.cloned:
|
||||
- name: https://github.com/pyenv/pyenv.git
|
||||
- target: /home/user/.pyenv
|
||||
- user: user
|
||||
|
||||
pyenv-virtual_cloned:
|
||||
git.cloned:
|
||||
- name: https://github.com/pyenv/pyenv-virtualenv.git
|
||||
- target: /home/user/.pyenv/plugins/pyenv-virtualenv
|
||||
- user: user
|
||||
|
||||
{% set current_path = salt['environ.get']('PATH', '/usr/local/bin:/usr/bin:/bin') %}
|
||||
|
||||
cmd-run:
|
||||
cmd.script:
|
||||
- source: salt://pyenv/setup.sh
|
||||
- cwd: /home/user/
|
||||
- runas: user
|
||||
- env:
|
||||
- PATH: {{ ['/home/user/.pyenv/bin', current_path]|join(':') }}
|
||||
|
||||
{% endif %}
|
Loading…
x
Reference in New Issue
Block a user