From 394b757cee57248d6cc0651d3d87482bf07d8a25 Mon Sep 17 00:00:00 2001 From: Alex Maca Date: Fri, 30 Dec 2022 16:36:55 +0200 Subject: [PATCH 1/5] Change from include_tasks to import_tasks --- tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 6a724a4..22240f3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -42,7 +42,7 @@ # Installation tasks - name: Include tasks for installation on {{ ansible_os_family | lower }} distribution - include_tasks: "install-{{ ansible_os_family | lower }}.yml" + import_tasks: "install-{{ ansible_os_family | lower }}.yml" when: > ansible_os_family == 'RedHat' or ansible_os_family == 'Debian' tags: @@ -50,6 +50,6 @@ # Configuration tasks - name: Configure {{ cwa_package }} for {{ ansible_distribution | lower }} - include_tasks: "configure.yml" + import_tasks: "configure.yml" tags: - configure From 01b165f143f33f704518590831a9edb695e3340e Mon Sep 17 00:00:00 2001 From: Alex Maca Date: Fri, 30 Dec 2022 16:50:53 +0200 Subject: [PATCH 2/5] Add missing tag --- tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 22240f3..a31ac65 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -27,6 +27,8 @@ - name: Set architecture name set_fact: cwa_arch_name: "{{ cwa_arch_names.get(ansible_architecture) }}" + tags: + - include-vars # Include of vars - name: Include variables for {{ ansible_distribution | lower }} From c18c3e3a2c02c04c36b5733e7b903f85c77b8023 Mon Sep 17 00:00:00 2001 From: Alex Maca Date: Fri, 30 Dec 2022 17:09:19 +0200 Subject: [PATCH 3/5] revert to include for install tasks Static imports cannot use variables from facts or inventory --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index a31ac65..e71922f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,7 +44,7 @@ # Installation tasks - name: Include tasks for installation on {{ ansible_os_family | lower }} distribution - import_tasks: "install-{{ ansible_os_family | lower }}.yml" + include_tasks: "install-{{ ansible_os_family | lower }}.yml" when: > ansible_os_family == 'RedHat' or ansible_os_family == 'Debian' tags: From be680181c1ff0592cfcefcd58b227775f2823e67 Mon Sep 17 00:00:00 2001 From: Alex Maca Date: Fri, 30 Dec 2022 17:11:42 +0200 Subject: [PATCH 4/5] add apply tags to include_tasks --- tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index e71922f..dbb182f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -49,6 +49,10 @@ ansible_os_family == 'RedHat' or ansible_os_family == 'Debian' tags: - include-install-task + apply: + tags: + - include-install-task + # Configuration tasks - name: Configure {{ cwa_package }} for {{ ansible_distribution | lower }} From 454f1f789eff120df81e57682fb3b227fd725b5f Mon Sep 17 00:00:00 2001 From: Alex Maca Date: Fri, 30 Dec 2022 17:13:56 +0200 Subject: [PATCH 5/5] fix apply --- tasks/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index dbb182f..899567b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,15 +44,15 @@ # Installation tasks - name: Include tasks for installation on {{ ansible_os_family | lower }} distribution - include_tasks: "install-{{ ansible_os_family | lower }}.yml" + include_tasks: + file: "install-{{ ansible_os_family | lower }}.yml" + apply: + tags: + - include-install-task when: > ansible_os_family == 'RedHat' or ansible_os_family == 'Debian' tags: - include-install-task - apply: - tags: - - include-install-task - # Configuration tasks - name: Configure {{ cwa_package }} for {{ ansible_distribution | lower }}