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.
This commit is contained in:
Jesse Pretorius 2018-03-24 14:19:12 +00:00
parent b77b1aabd3
commit b8b8da13f6
1 changed files with 3 additions and 2 deletions

View File

@ -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