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