Skip to content

Commit c5340c0

Browse files
committed
Use set-template meta action.
1 parent df46be0 commit c5340c0

5 files changed

+136
-407
lines changed

docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,29 @@ Let us use the below list in the following examples:
1717

1818
actions:
1919
- name: reset-previous-blocks
20+
- name: set-template
21+
template:
22+
env:
23+
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
24+
variables:
25+
data:
26+
previous_code_block: yaml
27+
previous_code_block_index: 0
28+
computation:
29+
previous_code_block: yaml+jinja
30+
postprocessors:
31+
- name: reformat-yaml
32+
language: yaml
33+
skip_first_lines: 2
34+
playbook: |-
35+
- hosts: localhost
36+
gather_facts: false
37+
tasks:
38+
- vars:
39+
@{{ data | indent(8) }}@
40+
@{{ computation | indent(8) }}@
41+
ansible.builtin.debug:
42+
var: result
2043

2144
.. code-block:: yaml
2245
@@ -44,27 +67,7 @@ gives
4467

4568
.. ansible-output-data::
4669

47-
env:
48-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
49-
variables:
50-
data:
51-
previous_code_block: yaml
52-
previous_code_block_index: 0
53-
computation:
54-
previous_code_block: yaml+jinja
55-
postprocessors:
56-
- name: reformat-yaml
57-
language: yaml
58-
skip_first_lines: 2
59-
playbook: |-
60-
- hosts: localhost
61-
gather_facts: false
62-
tasks:
63-
- vars:
64-
@{{ data | indent(8) }}@
65-
@{{ computation | indent(8) }}@
66-
ansible.builtin.debug:
67-
var: result
70+
playbook: ~
6871

6972
.. code-block:: yaml
7073
:emphasize-lines: 1-
@@ -82,18 +85,6 @@ gives
8285

8386
.. ansible-output-data::
8487

85-
env:
86-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
87-
variables:
88-
data:
89-
previous_code_block: yaml
90-
previous_code_block_index: 0
91-
computation:
92-
previous_code_block: yaml+jinja
93-
postprocessors:
94-
- name: reformat-yaml
95-
language: yaml
96-
skip_first_lines: 2
9788
playbook: |-
9889
- hosts: localhost
9990
gather_facts: false
@@ -168,18 +159,6 @@ gives
168159

169160
.. ansible-output-data::
170161

171-
env:
172-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
173-
variables:
174-
data:
175-
previous_code_block: yaml
176-
previous_code_block_index: 0
177-
computation:
178-
previous_code_block: yaml+jinja
179-
postprocessors:
180-
- name: reformat-yaml
181-
language: yaml
182-
skip_first_lines: 2
183162
playbook: |-
184163
- hosts: localhost
185164
gather_facts: false

docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,29 @@ Let us use the below list in the following examples:
1717

1818
actions:
1919
- name: reset-previous-blocks
20+
- name: set-template
21+
template:
22+
env:
23+
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
24+
variables:
25+
data:
26+
previous_code_block: yaml
27+
previous_code_block_index: 0
28+
computation:
29+
previous_code_block: yaml+jinja
30+
postprocessors:
31+
- name: reformat-yaml
32+
language: yaml
33+
skip_first_lines: 2
34+
playbook: |-
35+
- hosts: localhost
36+
gather_facts: false
37+
tasks:
38+
- vars:
39+
@{{ data | indent(8) }}@
40+
@{{ computation | indent(8) }}@
41+
ansible.builtin.debug:
42+
var: result
2043

2144
.. code-block:: yaml
2245
@@ -44,27 +67,7 @@ gives
4467

4568
.. ansible-output-data::
4669

47-
env:
48-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
49-
variables:
50-
data:
51-
previous_code_block: yaml
52-
previous_code_block_index: 0
53-
computation:
54-
previous_code_block: yaml+jinja
55-
postprocessors:
56-
- name: reformat-yaml
57-
language: yaml
58-
skip_first_lines: 2
59-
playbook: |-
60-
- hosts: localhost
61-
gather_facts: false
62-
tasks:
63-
- vars:
64-
@{{ data | indent(8) }}@
65-
@{{ computation | indent(8) }}@
66-
ansible.builtin.debug:
67-
var: result
70+
playbook: ~
6871

6972
.. code-block:: yaml
7073
:emphasize-lines: 1-
@@ -84,18 +87,6 @@ gives
8487

8588
.. ansible-output-data::
8689

87-
env:
88-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
89-
variables:
90-
data:
91-
previous_code_block: yaml
92-
previous_code_block_index: 0
93-
computation:
94-
previous_code_block: yaml+jinja
95-
postprocessors:
96-
- name: reformat-yaml
97-
language: yaml
98-
skip_first_lines: 2
9990
playbook: |-
10091
- hosts: localhost
10192
gather_facts: false
@@ -172,18 +163,6 @@ gives
172163

173164
.. ansible-output-data::
174165

175-
env:
176-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
177-
variables:
178-
data:
179-
previous_code_block: yaml
180-
previous_code_block_index: 0
181-
computation:
182-
previous_code_block: yaml+jinja
183-
postprocessors:
184-
- name: reformat-yaml
185-
language: yaml
186-
skip_first_lines: 2
187166
playbook: |-
188167
- hosts: localhost
189168
gather_facts: false

docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst

Lines changed: 30 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,29 @@ Let us use the below list in the following examples:
1717

1818
actions:
1919
- name: reset-previous-blocks
20+
- name: set-template
21+
template:
22+
env:
23+
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
24+
variables:
25+
data:
26+
previous_code_block: yaml
27+
previous_code_block_index: 0
28+
computation:
29+
previous_code_block: yaml+jinja
30+
postprocessors:
31+
- name: reformat-yaml
32+
language: yaml
33+
skip_first_lines: 2
34+
playbook: |-
35+
- hosts: localhost
36+
gather_facts: false
37+
tasks:
38+
- vars:
39+
@{{ data | indent(8) }}@
40+
@{{ computation | indent(8) }}@
41+
ansible.builtin.debug:
42+
var: result
2043

2144
.. code-block:: yaml
2245
@@ -47,27 +70,7 @@ gives
4770

4871
.. ansible-output-data::
4972

50-
env:
51-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
52-
variables:
53-
data:
54-
previous_code_block: yaml
55-
previous_code_block_index: 0
56-
computation:
57-
previous_code_block: yaml+jinja
58-
postprocessors:
59-
- name: reformat-yaml
60-
language: yaml
61-
skip_first_lines: 2
62-
playbook: |-
63-
- hosts: localhost
64-
gather_facts: false
65-
tasks:
66-
- vars:
67-
@{{ data | indent(8) }}@
68-
@{{ computation | indent(8) }}@
69-
ansible.builtin.debug:
70-
var: result
73+
playbook: ~
7174

7275
.. code-block:: yaml
7376
:emphasize-lines: 1-
@@ -91,18 +94,6 @@ gives
9194

9295
.. ansible-output-data::
9396

94-
env:
95-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
96-
variables:
97-
data:
98-
previous_code_block: yaml
99-
previous_code_block_index: 0
100-
computation:
101-
previous_code_block: yaml+jinja
102-
postprocessors:
103-
- name: reformat-yaml
104-
language: yaml
105-
skip_first_lines: 2
10697
playbook: |-
10798
- hosts: localhost
10899
gather_facts: false
@@ -176,18 +167,6 @@ gives
176167

177168
.. ansible-output-data::
178169

179-
env:
180-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
181-
variables:
182-
data:
183-
previous_code_block: yaml
184-
previous_code_block_index: 0
185-
computation:
186-
previous_code_block: yaml+jinja
187-
postprocessors:
188-
- name: reformat-yaml
189-
language: yaml
190-
skip_first_lines: 2
191170
playbook: |-
192171
- hosts: localhost
193172
gather_facts: false
@@ -237,6 +216,11 @@ gives
237216

238217
6. If there are more matches for a key the first one will be used.
239218

219+
.. ansible-output-meta::
220+
221+
actions:
222+
- name: reset-previous-blocks
223+
240224
.. code-block:: yaml
241225
:emphasize-lines: 1-
242226
@@ -259,26 +243,7 @@ gives
259243

260244
.. ansible-output-data::
261245

262-
env:
263-
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml
264-
variables:
265-
data:
266-
previous_code_block: yaml
267-
computation:
268-
previous_code_block: yaml+jinja
269-
postprocessors:
270-
- name: reformat-yaml
271-
language: yaml
272-
skip_first_lines: 2
273-
playbook: |-
274-
- hosts: localhost
275-
gather_facts: false
276-
tasks:
277-
- vars:
278-
@{{ data | indent(8) }}@
279-
@{{ computation | indent(8) }}@
280-
ansible.builtin.debug:
281-
var: result
246+
playbook: ~
282247

283248
.. code-block:: yaml
284249
:emphasize-lines: 1-

0 commit comments

Comments
 (0)