|
59 | 59 | - 5
|
60 | 60 | - 6
|
61 | 61 |
|
62 |
| - # disable trim_blocks and see difference |
63 | 62 | tasks:
|
64 | 63 | - name: Get available z/OS facts to use with the templates.
|
65 | 64 | ibm.ibm_zos_core.zos_gather_facts:
|
|
72 | 71 | dest: "{{ json_path }}"
|
73 | 72 | use_template: true
|
74 | 73 |
|
75 |
| - - name: Get the contents of {{ json_path }} |
| 74 | + - name: See the contents of {{ json_path }} |
76 | 75 | ansible.builtin.command: "cat {{ json_path }}"
|
77 |
| - register: output |
78 |
| - |
79 |
| - - name: See the contents of the rendered template. |
80 |
| - ansible.builtin.debug: |
81 |
| - msg: "{{ output.stdout }}" |
82 | 76 |
|
83 | 77 | - name: Erase remote files.
|
84 | 78 | ansible.builtin.file:
|
|
100 | 94 | dest: "{{ default_dataset_name }}"
|
101 | 95 | use_template: true
|
102 | 96 |
|
103 |
| - - name: Get the contents of {{ default_dataset_name }}. |
| 97 | + - name: See the contents of {{ default_dataset_name }}. |
104 | 98 | ansible.builtin.command: "cat \"//'{{ default_dataset_name }}'\""
|
105 |
| - register: output |
106 |
| - |
107 |
| - - name: See the contents of the rendered template. |
108 |
| - ansible.builtin.debug: |
109 |
| - msg: "{{ output.stdout }}" |
110 | 99 |
|
111 | 100 | # Dataset using custom markers.
|
112 | 101 | - name: Create a temporary dataset name.
|
|
126 | 115 | variable_start_string: "(("
|
127 | 116 | variable_end_string: "))"
|
128 | 117 |
|
129 |
| - - name: Get the contents of {{ custom_dataset_name }}. |
| 118 | + - name: See the contents of {{ custom_dataset_name }}. |
130 | 119 | ansible.builtin.command: "cat \"//'{{ custom_dataset_name }}'\""
|
131 |
| - register: output |
132 | 120 |
|
133 |
| - - name: See the contents of the rendered template. |
134 |
| - ansible.builtin.debug: |
135 |
| - msg: "{{ output.stdout }}" |
| 121 | + # Rendering records.j2 again, but changing how whitespace is handled. |
| 122 | + # This task will create empty records due to not trimming newlines |
| 123 | + # after rendering blocks. |
| 124 | + - name: Copy a template to a dataset without trimming whitespace. |
| 125 | + zos_copy: |
| 126 | + src: ./files/records.j2 |
| 127 | + dest: "{{ default_dataset_name }}" |
| 128 | + use_template: true |
| 129 | + force: true |
| 130 | + template_parameters: |
| 131 | + trim_blocks: false |
| 132 | + keep_trailing_newline: true |
| 133 | + |
| 134 | + - name: See the contents of {{ default_dataset_name }}. Note the blank lines. |
| 135 | + ansible.builtin.command: "cat \"//'{{ default_dataset_name }}'\"" |
136 | 136 |
|
137 | 137 | - name: Erase datasets.
|
138 | 138 | ibm.ibm_zos_core.zos_data_set:
|
|
0 commit comments