Debian Codegraph @

test/integration/targets/includes/roles/test_includes/tasks/main.yml

raw
1 # test code for the ping module
2 # (c) 2014, James Cammarata <[email protected]>
3
4 # This file is part of Ansible
5 #
6 # Ansible is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Ansible is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18
19
20 # now try long form includes
21
22 - include_tasks: included_task1.yml
23 vars:
24 a: 201
25 b: 202
26 c: 203
27
28 - debug: var=a
29 - debug: var=b
30 - debug: var=c
31
32 - name: verify long-form include params
33 assert:
34 that:
35 - "ca == 201"
36 - "cb == 202"
37 - "cc == 203"
38
39 - name: test handlers with includes
40 shell: echo 1
41 notify:
42 # both these via a handler include
43 - included_handler
44 - verify_handler
45
46 - include_tasks: branch_toplevel.yml
47 vars:
48 canary: value1
49 nested_include_static: 'no'
50 - assert:
51 that:
52 - 'canary_fact == "value1"'
53
54 - include_tasks: branch_toplevel.yml
55 vars:
56 canary: value2
57 nested_include_static: 'yes'
58 - assert:
59 that:
60 - 'canary_fact == "value2"'
61
62 - import_tasks: branch_toplevel.yml
63 vars:
64 canary: value3
65 nested_include_static: 'no'
66 - assert:
67 that:
68 - 'canary_fact == "value3"'
69
70 - import_tasks: branch_toplevel.yml
71 vars:
72 canary: value4
73 nested_include_static: 'yes'
74 - assert:
75 that:
76 - 'canary_fact == "value4"'