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
This commit is contained in:
Mohammed Naser 2018-11-02 18:59:52 +01:00
parent 96b1500fe6
commit 135f7bf364
2 changed files with 2 additions and 3 deletions

View File

@ -70,6 +70,8 @@
- always
- include_tasks: nova_virt_detect.yml
when:
- nova_virt_type is not defined
tags:
- always
- nova-config

View File

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