From 6ce3958ed49afadbff00fd7e64f7e25f91d59bda Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Tue, 18 Jul 2017 13:06:27 +0100 Subject: [PATCH] Use direct include instead of "with_first_found" We specify the full path and are not searching for a generic file, we should rather use a direct include instead of using "with_first_found". Additionally, we need the include paths within drivers/virt_type to be relative rather than absolute - otherwise these files fail to be included properly. Change-Id: Ie9bd6d778d134bcba28f19a5e7895ccb8bb26da9 --- tasks/drivers/kvm/nova_compute_kvm.yml | 8 ++++---- tasks/nova_compute.yml | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tasks/drivers/kvm/nova_compute_kvm.yml b/tasks/drivers/kvm/nova_compute_kvm.yml index e1003c75..594833e7 100644 --- a/tasks/drivers/kvm/nova_compute_kvm.yml +++ b/tasks/drivers/kvm/nova_compute_kvm.yml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include: drivers/kvm/nova_compute_kvm_install.yml +- include: nova_compute_kvm_install.yml tags: - nova-config @@ -34,7 +34,7 @@ - nova-kvm - name: Set kernel permissions to enable libguestfs features (Ubuntu) - include: drivers/kvm/nova_kernel_permissions.yml + include: nova_kernel_permissions.yml when: - ansible_distribution == 'Ubuntu' - nova_libvirt_inject_key | bool or nova_libvirt_inject_password | bool @@ -113,13 +113,13 @@ - nova-kvm - nova-libvirt -- include: drivers/kvm/nova_disable_smt.yml +- include: nova_disable_smt.yml when: - ansible_architecture == 'ppc64le' tags: - nova-config -- include: drivers/kvm/nova_compute_kvm_virsh_net_remove.yml +- include: nova_compute_kvm_virsh_net_remove.yml tags: - nova-config - nova-kvm diff --git a/tasks/nova_compute.yml b/tasks/nova_compute.yml index 91457fe3..adfa793d 100644 --- a/tasks/nova_compute.yml +++ b/tasks/nova_compute.yml @@ -13,12 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include: "{{ item }}" - with_first_found: - - files: - - "nova_compute_{{ nova_virt_type }}.yml" - paths: - - "drivers/{{ nova_virt_type }}/" +- include: "drivers/{{ nova_virt_type }}/nova_compute_{{ nova_virt_type }}.yml" tags: - nova-install