diff --git a/tasks/main.yml b/tasks/main.yml index adc42439..6fdda849 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -25,7 +25,8 @@ - always - name: Fail when virt type is unsupported - fail: msg="Unsupported Virt Type Provided {{ nova_supported_virt_types }}" + fail: + msg: "Unsupported Virt Type Provided {{ nova_supported_virt_types }}" when: - nova_virt_type is defined - nova_virt_type not in nova_supported_virt_types diff --git a/tasks/nova_compute.yml b/tasks/nova_compute.yml index 94d71303..91457fe3 100644 --- a/tasks/nova_compute.yml +++ b/tasks/nova_compute.yml @@ -17,7 +17,6 @@ with_first_found: - files: - "nova_compute_{{ nova_virt_type }}.yml" - skip: true paths: - "drivers/{{ nova_virt_type }}/" tags: diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index 897c987d..1e3ca345 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -153,13 +153,7 @@ with_items: - "{{ install_nova_role_packages.results }}" -- include: "{{ item }}" - with_first_found: - - files: - - "nova_console_{{ nova_console_type }}_install.yml" - skip: true - paths: - - "consoles/" +- include: "consoles/nova_console_{{ nova_console_type }}_install.yml" when: - "'nova_console' in group_names" tags: diff --git a/tasks/nova_install_apt.yml b/tasks/nova_install_apt.yml index 20dcb942..d139ab42 100644 --- a/tasks/nova_install_apt.yml +++ b/tasks/nova_install_apt.yml @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Only PowerVM needs to load a separate file. Skip for the others. - include: "{{ item }}" with_first_found: - files: diff --git a/tasks/nova_virt_detect.yml b/tasks/nova_virt_detect.yml index bb9ccb65..2859f88c 100644 --- a/tasks/nova_virt_detect.yml +++ b/tasks/nova_virt_detect.yml @@ -13,38 +13,38 @@ # See the License for the specific language governing permissions and # limitations under the License. -- block: - - name: Get CPU info content and store as var - command: cat /proc/cpuinfo - register: cpuinfo_contents - changed_when: false - tags: - - always +- name: Get CPU info content and store as var + command: cat /proc/cpuinfo + register: cpuinfo_contents + changed_when: false + tags: + - always - - name: Register a fact for the nova kvm virt type - set_fact: - nova_virt_type: "kvm" - when: cpuinfo_contents.stdout.find('vmx') != -1 - or cpuinfo_contents.stdout.find('svm') != -1 - or cpuinfo_contents.stdout.find('PowerNV') != -1 - or (cpuinfo_contents.stdout.find('pSeries') != -1 - and cpuinfo_contents.stdout.find('qemu') != -1 - and ansible_architecture == 'ppc64le') - tags: - - nova-virt-type-set +- name: Register a fact for the nova qemu virt type + set_fact: + nova_virt_type: "qemu" + tags: + - always - - name: Register a fact for the nova powervm virt type - set_fact: - nova_virt_type: "powervm" - when: - - cpuinfo_contents.stdout.find('pSeries') != -1 - - ansible_architecture == 'ppc64le' - - cpuinfo_contents.stdout.find('qemu') == -1 - tags: - - nova-virt-type-set - rescue: - - name: Register a fact for the nova qemu virt type - set_fact: - nova_virt_type: "qemu" - tags: - - always +- name: Register a fact for the nova kvm virt type + set_fact: + nova_virt_type: "kvm" + when: + - cpuinfo_contents.stdout.find('vmx') != -1 + or cpuinfo_contents.stdout.find('svm') != -1 + or cpuinfo_contents.stdout.find('PowerNV') != -1 + or (cpuinfo_contents.stdout.find('pSeries') != -1 + and cpuinfo_contents.stdout.find('qemu') != -1 + and ansible_architecture == 'ppc64le') + tags: + - nova-virt-type-set + +- name: Register a fact for the nova powervm virt type + set_fact: + nova_virt_type: "powervm" + when: + - cpuinfo_contents.stdout.find('pSeries') != -1 + - ansible_architecture == 'ppc64le' + - cpuinfo_contents.stdout.find('qemu') == -1 + tags: + - nova-virt-type-set