blob: 8f07bb9090f4d2ed7a0c5a49dbf723fc49de690f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
- name: Test import_tasks
hosts: testhost
tasks:
- name: Test basic task import
import_tasks: tasks1.yml
- name: Assert that fact was set in import
assert:
that:
- set_in_tasks1
- name: Test conditional task import
import_tasks: tasks2.yml
when: no
- name: Assert that tasks were skipped
assert:
that:
- set_in_tasks2 is not defined
- block:
- name: Import tasks inside a block
import_tasks: tasks3.yml
- name: Assert that task3 was included
assert:
that:
- set_in_tasks3
always:
- name: Import task inside always
import_tasks: tasks4.yml
- name: Validate that variables set in previously improted tasks are passed down.
import_tasks: validate3.yml
- name: Assert that tasks4 was included
assert:
that:
- set_in_tasks4
|