From 01c17f6af62df01c221ee15d25c96ae438f5fb16 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Thu, 14 Jul 2016 14:59:19 -0400 Subject: [PATCH] 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 --- ansible/install/roles/browbeat/tasks/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansible/install/roles/browbeat/tasks/main.yml b/ansible/install/roles/browbeat/tasks/main.yml index 0d9e9ca83..bfec82cdb 100644 --- a/ansible/install/roles/browbeat/tasks/main.yml +++ b/ansible/install/roles/browbeat/tasks/main.yml @@ -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: