From 5fa83e9936879693ed6350d40207ba4df0d285f8 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Wed, 8 Nov 2017 12:02:46 +0100
Subject: [PATCH] ansible-playbooks/general#72 All includes are now
 include_tasks and they always have a tag associated

---
 tasks/ec2/inithost.yml | 4 +++-
 tasks/inithost.yml     | 3 ++-
 tasks/main.yml         | 8 +++++---
 tasks/removehost.yml   | 3 ++-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tasks/ec2/inithost.yml b/tasks/ec2/inithost.yml
index 599419c..c2f1c7d 100644
--- a/tasks/ec2/inithost.yml
+++ b/tasks/ec2/inithost.yml
@@ -36,7 +36,8 @@
       state: present
     with_items: '{{ ec2.instance_ids }}'
 
-  - import_tasks: inithostip.yml hostip='{{ inithostip }}'
+  - include_tasks: inithostip.yml hostip='{{ inithostip }}'
+    tags: 'always'
 
   when: inithostip is defined
 
@@ -45,3 +46,4 @@
   loop_control:
     loop_var: ec2instance
   when: inithostip is not defined
+  tags: 'always'
diff --git a/tasks/inithost.yml b/tasks/inithost.yml
index 086e197..f59433d 100644
--- a/tasks/inithost.yml
+++ b/tasks/inithost.yml
@@ -1,4 +1,5 @@
 ---
 # file: inithost.yml
 
-- import_tasks: "cleanup.yml"
+- include_tasks: "cleanup.yml"
+  tags: 'always'
diff --git a/tasks/main.yml b/tasks/main.yml
index 4c7791b..0197dc8 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -3,12 +3,14 @@
 
 - name: "Cloud Role"
   set_fact: role_cloud_started=true
-  tags: always
+  tags: 'always'
 
 - block:
 
-  - import_tasks: "{{ cloud|default('none') }}/{{ mode }}.yml"
+  - include_tasks: "{{ cloud|default('none') }}/{{ mode }}.yml"
+    tags: 'always'
 
-  - import_tasks: "{{ mode }}.yml"
+  - include_tasks: "{{ mode }}.yml"
+    tags: 'always'
 
   when: '"cloud" not in excluded_roles'
diff --git a/tasks/removehost.yml b/tasks/removehost.yml
index bab0816..79eeebb 100644
--- a/tasks/removehost.yml
+++ b/tasks/removehost.yml
@@ -1,5 +1,6 @@
 ---
 # file: removehost.yml
 
-- import_tasks: "cleanup.yml"
+- include_tasks: "cleanup.yml"
   when: are_you_sure == "YES"
+  tags: 'always'
-- 
GitLab