Handle case where perfkit is already cloned

In a case where the install playbook has already been run and is rerun after
making changes to the local perfkit directory, the playbook fails. This commit
adds logic to skip cloning if perfkit already exists.

Change-Id: I705465e95b59f0fb4eecff587392dc3056475d87
This commit is contained in:
Sai Sindhur Malleni 2016-07-14 14:59:19 -04:00
parent e12759dc3c
commit 01c17f6af6

View File

@ -64,11 +64,20 @@
- name: Install requirements.txt into browbeat-venv
pip: requirements={{ browbeat_path }}/requirements.txt virtualenv={{ browbeat_venv }}
- name: Determine if perfkit is already cloned
stat: path={{ perfkit_venv }}/PerfKitBenchmarker
register: perfkit_exists
- debug: msg="PerfKit already exists on the host"
when: perfkit_exists.stat.isdir is defined and perfkit_exists.stat.isdir
- name: Clone PerfKitBenchmarker on undercloud
git:
repo=https://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git
dest={{ perfkit_venv }}/PerfKitBenchmarker
version=v1.4.0
when: perfkit_exists.stat.isdir is undefined
- name: Install PerfKitBenchmarker requirements into perfkit-venv
pip: