From 69f49918f4093b7663a2d0123666c0b27e969e09 Mon Sep 17 00:00:00 2001 From: Biel Stela Date: Mon, 8 Mar 2021 13:22:36 +0100 Subject: [PATCH 1/4] Adds git version param to pyenv and pyenv-virtualenv installation --- defaults/main.yml | 4 ++++ tasks/install.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 4104005..6880a98 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: diff --git a/tasks/install.yml b/tasks/install.yml index f733a78..9cecc1f 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -3,12 +3,14 @@ git: repo: https://github.com/pyenv/pyenv.git dest: "{{ pyenv_path }}" + version: "{{ pyenv_git_ref }}" update: "{{ pyenv_update_git_install }}" - name: Install PyEnv-virtualenv plugin git: repo: https://github.com/yyuu/pyenv-virtualenv.git dest: "{{ pyenv_path }}/plugins/pyenv-virtualenv" + version: "{{ pyenv_virtualenv_git_ref }}" update: "{{ pyenv_update_git_install }}" - name: Install PyEnv-update plugin From 44950b9c315040cababa03d7ac966c93dd703543 Mon Sep 17 00:00:00 2001 From: Biel Stela Date: Mon, 8 Mar 2021 13:25:12 +0100 Subject: [PATCH 2/4] Adds todo --- tasks/install.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/install.yml b/tasks/install.yml index 9cecc1f..0ec22f2 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -4,6 +4,7 @@ repo: https://github.com/pyenv/pyenv.git dest: "{{ pyenv_path }}" version: "{{ pyenv_git_ref }}" + # TODO: Make update always yes if "version" is specified update: "{{ pyenv_update_git_install }}" - name: Install PyEnv-virtualenv plugin @@ -11,6 +12,7 @@ repo: https://github.com/yyuu/pyenv-virtualenv.git dest: "{{ pyenv_path }}/plugins/pyenv-virtualenv" version: "{{ pyenv_virtualenv_git_ref }}" + # TODO: Make update always yes if "version" is specified update: "{{ pyenv_update_git_install }}" - name: Install PyEnv-update plugin From 5115acaa60bc4cd89beb1e69b7126c528c96efd4 Mon Sep 17 00:00:00 2001 From: Biel Stela Date: Tue, 9 Mar 2021 09:48:40 +0100 Subject: [PATCH 3/4] Adds default installation if git ref is undefined --- tasks/install.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 0ec22f2..06d4177 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,19 +1,33 @@ --- -- name: Install PyEnv +- name: Install PyEnv from git ref git: repo: https://github.com/pyenv/pyenv.git dest: "{{ pyenv_path }}" version: "{{ pyenv_git_ref }}" - # TODO: Make update always yes if "version" is specified + update: "yes" + 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 +- 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 }}" - # TODO: Make update always yes if "version" is specified + update: "yes" + 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: From f74b624069cf90e103e4c2417c36963206d812d7 Mon Sep 17 00:00:00 2001 From: Biel Stela Date: Tue, 9 Mar 2021 09:53:45 +0100 Subject: [PATCH 4/4] Removes default yes and fixes indent --- tasks/install.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 06d4177..321eaa2 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -4,30 +4,28 @@ repo: https://github.com/pyenv/pyenv.git dest: "{{ pyenv_path }}" version: "{{ pyenv_git_ref }}" - update: "yes" - when: 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 + 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 }}" - update: "yes" - when: 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 + when: pyenv_virtualenv_git_ref is undefined - name: Install PyEnv-update plugin git: