summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/include_import/tasks/test_include_tasks.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/include_import/tasks/test_include_tasks.yml')
-rw-r--r--test/integration/targets/include_import/tasks/test_include_tasks.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/integration/targets/include_import/tasks/test_include_tasks.yml b/test/integration/targets/include_import/tasks/test_include_tasks.yml
new file mode 100644
index 0000000..ebe2273
--- /dev/null
+++ b/test/integration/targets/include_import/tasks/test_include_tasks.yml
@@ -0,0 +1,44 @@
+- name: Test include_tasks
+ hosts: testhost
+
+ tasks:
+ - name: Test basic task include
+ include_tasks: tasks1.yml
+
+ - name: Assert that fact was set in include
+ assert:
+ that:
+ - set_in_tasks1
+
+ - name: Test conditional task include
+ include_tasks: tasks2.yml
+ when: no
+
+ - name: Assert that tasks were skipped
+ assert:
+ that:
+ - set_in_tasks2 is not defined
+
+ - block:
+ - name: Include tasks inside a block
+ include_tasks: tasks3.yml
+
+ - name: Assert that task3 was included
+ assert:
+ that:
+ - set_in_tasks3
+
+ always:
+ - name: Include task inside always
+ include_tasks: tasks4.yml
+
+ - name: Validate that variables set in previously improted tasks are passed down
+ include_tasks: validate3.yml
+
+ - name: Assert that tasks4 was included
+ assert:
+ that:
+ - set_in_tasks4
+
+ - name: include_tasks + action
+ action: include_tasks tasks1.yml