Make sure ansible_distribution is defined

If the ansible_distribution fact is not gathered, then the
overcloud-deploy role will just fail while trying to
evaluate it.

Instead we just make sure it is defined before trying to
evaluate it. This will have the consequence of any deploy
which cannot check the ansible_distribution not getting the
libvirt_args set unless by explicit config. However, that
seems better than failing outright.

Closes-Bug: #1721790

Change-Id: I08c689b949372bae9ffd7eb4ce9576c5b37d138d
This commit is contained in:
John Trowbridge 2017-10-06 10:46:23 -04:00
parent beb92a2c84
commit 0c451d80ea
1 changed files with 3 additions and 1 deletions

View File

@ -173,7 +173,9 @@
- name: Use KVM for Red Hat distro
set_fact: libvirt_args="--libvirt-type kvm"
when: ansible_distribution == 'RedHat'
when:
- ansible_distribution is defined
- ansible_distribution == 'RedHat'
- name: set container_args fact
set_fact: