From 9cc609c36fb0b22b56509f7b4914ec6fa59670c7 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Thu, 11 Apr 2019 16:36:21 -0400 Subject: [PATCH] fix loop --- tasks/main.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/main.yaml b/tasks/main.yaml index 0c26786..fc60617 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -10,4 +10,11 @@ - "{{ ansible_os_family | lower }}" - name: Install packages - import_tasks: "install/{{ ansible_distribution }}.yaml" \ No newline at end of file + include_tasks: "install/{{ item }}.yaml" + with_first_found: + - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}" + - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}" + - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}" + - "{{ ansible_distribution | lower }}" + - "{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}" + - "{{ ansible_os_family | lower }}" \ No newline at end of file