From b8b8da13f6e95471c44b59d7f6b3cae29419b452 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Sat, 24 Mar 2018 14:19:12 +0000 Subject: [PATCH] Ensure venv is extracted if the target folder was not present In the situation where a deployer may have removed the venv folder on the target host, but has not removed the the tgz/checksum file, the venv will not be extracted again. This patch ensures that if the venv folder was not there and gets created by the task then it will extract the tgz into the folder. --- tasks/python_venv_install.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/python_venv_install.yml b/tasks/python_venv_install.yml index a9336bb..004d8d9 100644 --- a/tasks/python_venv_install.yml +++ b/tasks/python_venv_install.yml @@ -33,6 +33,7 @@ file: path: "{{ venv_destination_path }}" state: directory + register: _venv_dir_create - name: Unarchive pre-built venv unarchive: @@ -40,8 +41,8 @@ dest: "{{ venv_destination_path }}" remote_src: no when: - - _venv_checksum_copy is mapping - - _venv_checksum_copy | changed + - (_venv_checksum_copy is mapping and _venv_checksum_copy | changed) or + _venv_dir_create | changed notify: - venv changed