From 135f7bf3648f012adee0f4fe1d858be804bc7945 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 2 Nov 2018 18:59:52 +0100 Subject: [PATCH] Avoid including nova_virt_detect if nova_virt_type is set There's no need for us to actually run through that entire set of tasks if the value is specified already. Change-Id: I6f3503fdfbe8fa43334da4360827078cd450ffcd --- tasks/main.yml | 2 ++ tasks/nova_virt_detect.yml | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 14586874..03cf617b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -70,6 +70,8 @@ - always - include_tasks: nova_virt_detect.yml + when: + - nova_virt_type is not defined tags: - always - nova-config diff --git a/tasks/nova_virt_detect.yml b/tasks/nova_virt_detect.yml index 81d29d90..11ed0e2b 100644 --- a/tasks/nova_virt_detect.yml +++ b/tasks/nova_virt_detect.yml @@ -17,14 +17,11 @@ command: cat /proc/cpuinfo register: cpuinfo_contents changed_when: false - when: - - nova_virt_type is not defined - name: Register a fact for the nova kvm virt type set_fact: nova_virt_type: "kvm" when: - - nova_virt_type is not defined - cpuinfo_contents.stdout.find('vmx') != -1 or cpuinfo_contents.stdout.find('svm') != -1 or cpuinfo_contents.stdout.find('PowerNV') != -1