From c060b6fff04b1bd232e0dafbef98db2f7c852f62 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Thu, 19 Jan 2017 11:48:21 +0000 Subject: [PATCH] Skip with_first_found when no files are found The upgrade tests we run in Ocata will run against stable/newton where the Redhat7 vars file does not exist, since we don't have Redhat7 support. Due to the way includes happen, the files are still evaluated, which means the task will fail. To avoid this we allow the task to be skipped if no file is found. After stable/newton the Redhat7 vars will be found, so we don't need this change in Ocata+. Change-Id: I022710814f545b913cc5097cc1bb6a21d223d808 --- tasks/main.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index c5628877..0d1832e0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,11 +16,13 @@ - name: Gather variables for each operating system include_vars: "{{ item }}" with_first_found: - - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml" - - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml" - - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml" - - "{{ ansible_distribution | lower }}.yml" - - "{{ ansible_os_family | lower }}.yml" + - files: + - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml" + - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml" + - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml" + - "{{ ansible_distribution | lower }}.yml" + - "{{ ansible_os_family | lower }}.yml" + skip: true tags: - always