Skip to content

Commit

Permalink
Enable to pin a specific version of pyenv.
Browse files Browse the repository at this point in the history
This PR is an updated version of avanov#54.

credits to @BielStela

Closes avanov#54
  • Loading branch information
diraol committed Mar 16, 2022
1 parent 59d8146 commit 4656dc2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ pyenv_update: no
pyenv_python_configure_opts: ""
pyenv_uninstall_python_w_wrong_configure_opts: no

# aditional option to pin the pyenv and pyenv-virtualenv version
pyenv_git_ref: ""
pyenv_virtualenv_git_ref: ""

pyenv_debian_packages:
- build-essential
# On Ubuntu 12.04 build may fail with the following error:
Expand Down
16 changes: 16 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
---
- name: Install PyEnv from git ref
git:
repo: https://github.com/pyenv/pyenv.git
dest: "{{ pyenv_path }}"
version: "{{ pyenv_git_ref }}"
when: pyenv_git_ref

- name: Install PyEnv
git:
repo: https://github.com/pyenv/pyenv.git
dest: "{{ pyenv_path }}"
update: "{{ pyenv_update_git_install }}"
when: pyenv_git_ref is undefined

- name: Install PyEnv-virtualenv plugin from git ref
git:
repo: https://github.com/yyuu/pyenv-virtualenv.git
dest: "{{ pyenv_path }}/plugins/pyenv-virtualenv"
version: "{{ pyenv_virtualenv_git_ref }}"
when: pyenv_virtualenv_git_ref

- name: Install PyEnv-virtualenv plugin
git:
repo: https://github.com/yyuu/pyenv-virtualenv.git
dest: "{{ pyenv_path }}/plugins/pyenv-virtualenv"
update: "{{ pyenv_update_git_install }}"
when: pyenv_virtualenv_git_ref is undefined

- name: Install PyEnv-update plugin
git:
Expand Down

0 comments on commit 4656dc2

Please sign in to comment.