From 2e2fba457fe14e226b5e6f3c3aa0543f0432c012 Mon Sep 17 00:00:00 2001 From: "Sergey Bubnov (omg)" Date: Fri, 19 Jul 2019 10:55:14 +0400 Subject: [PATCH] install prereqs only when needed --- provision.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/provision.yml b/provision.yml index ba8265c..f06812c 100644 --- a/provision.yml +++ b/provision.yml @@ -28,9 +28,13 @@ pre_tasks: - meta: end_play when: destroy_all is defined and destroy_all|bool + - name: check prereqs is already installed + shell: rpm -qa | grep -q python-modules-distutils + register: prereqs_found + changed_when: false - name: install prereqs raw: 'apt-get update && apt-get install -qy python2.7\(distutils\)' - when: destroy_all is not defined or not destroy_all + when: (destroy_all is not defined or not destroy_all) and (prereqs_found.rc != 0) - name: gather facts setup: when: destroy_all is not defined or not destroy_all