From deb34c3dd3891a96a3a1a041fde60c7e7b4b33a5 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Sat, 23 Mar 2019 15:34:48 -0400 Subject: [PATCH] Create nodepool_pip_virtualenv_symlink variable Expose the ability for a user to create a symlink to a nodepool virtualenv, this is usually needed when you start trying to version different virtualenv installs. Change-Id: Id77609f696dcd4083001a101fdd22ba1634f4617 Signed-off-by: Paul Belanger --- defaults/main.yaml | 1 + tasks/install/pip.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/defaults/main.yaml b/defaults/main.yaml index 6f35209..ff3600d 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -68,6 +68,7 @@ nodepool_pip_name: nodepool # nodepool_pip_version: # nodepool_pip_virtualenv_python: # nodepool_pip_virtualenv: +# nodepool_pip_virtualenv_symlink: nodepool_docker_name: - zuul/nodepool-builder diff --git a/tasks/install/pip.yaml b/tasks/install/pip.yaml index e084ffc..49f6e6b 100644 --- a/tasks/install/pip.yaml +++ b/tasks/install/pip.yaml @@ -22,3 +22,14 @@ version: "{{ nodepool_pip_version|default(omit) }}" virtualenv_python: "{{ nodepool_pip_virtualenv_python|default(omit) }}" virtualenv: "{{ nodepool_pip_virtualenv|default(omit) }}" + +- name: Symlink nodepool virtualenv + become: true + file: + src: "{{ nodepool_pip_virtualenv }}" + dest: "{{ nodepool_pip_virtualenv_symlink }}" + state: link + when: + - nodepool_pip_virtualenv is defined + - nodepool_pip_virtualenv_symlink is defined + - nodepool_pip_virtualenv != nodepool_pip_virtualenv_symlink