Debian Codegraph @

test/integration/targets/module_defaults/test_action_groups.yml

raw
1 ---
2 - hosts: localhost
3 gather_facts: no
4 tasks:
5 - name: test ansible.legacy short group name
6 module_defaults:
7 group/testgroup:
8 data: test
9 block:
10 - legacy_ping:
11 register: result
12 - assert:
13 that: "result.ping == 'pong'"
14
15 - ansible.legacy.legacy_ping:
16 register: result
17 - assert:
18 that: "result.ping == 'pong'"
19
20 - ping:
21 register: result
22 - assert:
23 that: "result.ping == 'test'"
24
25 - ansible.legacy.ping: # resolves to ansible.builtin.ping
26 register: result
27 - assert:
28 that: "result.ping == 'test'"
29
30 - ansible.builtin.ping:
31 register: result
32 - assert:
33 that: "result.ping == 'test'"
34
35 - formerly_core_ping:
36 register: result
37 - assert:
38 that: "result.ping == 'test'"
39
40 - ansible.builtin.formerly_core_ping:
41 register: result
42 - assert:
43 that: "result.ping == 'test'"
44
45 - name: test group that includes a legacy action
46 module_defaults:
47 # As of 2.12, legacy actions must be included in the action group definition
48 group/testlegacy:
49 data: test
50 block:
51 - legacy_ping:
52 register: result
53 - assert:
54 that: "result.ping == 'test'"
55
56 - ansible.legacy.legacy_ping:
57 register: result
58 - assert:
59 that: "result.ping == 'test'"
60
61 - name: test ansible.builtin fully qualified group name
62 module_defaults:
63 group/ansible.builtin.testgroup:
64 data: test
65 block:
66 # ansible.builtin does not contain ansible.legacy
67 - legacy_ping:
68 register: result
69 - assert:
70 that: "result.ping != 'test'"
71
72 # ansible.builtin does not contain ansible.legacy
73 - ansible.legacy.legacy_ping:
74 register: result
75 - assert:
76 that: "result.ping != 'test'"
77
78 - ping:
79 register: result
80 - assert:
81 that: "result.ping == 'test'"
82
83 # Resolves to ansible.builtin.ping
84 - ansible.legacy.ping:
85 register: result
86 - assert:
87 that: "result.ping == 'test'"
88
89 - ansible.builtin.ping:
90 register: result
91 - assert:
92 that: "result.ping == 'test'"
93
94 - formerly_core_ping:
95 register: result
96 - assert:
97 that: "result.ping == 'test'"
98
99 - ansible.builtin.formerly_core_ping:
100 register: result
101 - assert:
102 that: "result.ping == 'test'"
103
104 - name: test collection group name
105 module_defaults:
106 group/testns.testcoll.testgroup:
107 data: test
108 block:
109 # Plugin resolving to a different collection does not get the default
110 - ping:
111 register: result
112 - assert:
113 that: "result.ping != 'test'"
114
115 - formerly_core_ping:
116 register: result
117 - assert:
118 that: "result.ping == 'test'"
119
120 - ansible.builtin.formerly_core_ping:
121 register: result
122 - assert:
123 that: "result.ping == 'test'"
124
125 - testns.testcoll.ping:
126 register: result
127 - assert:
128 that: "result.ping == 'test'"
129
130 - metadata:
131 collections:
132 - testns.testcoll
133
134 - name: Test action plugin templates group defaults
135 vars:
136 setup_subset:
137 - "!all"
138 - "!min"
139 - local
140 module_defaults:
141 group/testns.testcoll.contains_setup:
142 gather_subset: "{{ setup_subset }}"
143 block:
144 - gather_facts:
145 - assert:
146 that:
147 - ansible_facts.gather_subset == setup_subset