|
124 | 124 | when: command_checks is defined or azure_checks is defined or module_checks is defined |
125 | 125 |
|
126 | 126 | - name: "{{ check_type.name }} - Execute command-based configuration checks" |
127 | | - when: command_checks is defined and command_checks | length > 0 |
| 127 | + when: |
| 128 | + - command_checks is defined |
| 129 | + - command_checks | length > 0 |
128 | 130 | block: |
129 | 131 | - name: "{{ check_type.name }} - Run command-based configuration checks" |
130 | 132 | become: true |
|
147 | 149 | msg: "Command-based configuration checks failed {{ command_check_results.msg }}" |
148 | 150 |
|
149 | 151 | - name: "{{ check_type.name }} - Debug the logs from configuration check python module" |
150 | | - when: command_check_results is defined and command_check_results.log is defined |
| 152 | + when: |
| 153 | + - command_check_results is defined |
| 154 | + - command_check_results.log is defined |
151 | 155 | ansible.builtin.debug: |
152 | 156 | msg: "{{ command_check_results.log }}" |
153 | 157 | verbosity: 1 |
154 | 158 |
|
155 | 159 | - name: "{{ check_type.name }} - Execute Azure-based configuration checks" |
156 | | - when: azure_checks is defined and azure_checks | length > 0 |
| 160 | + when: |
| 161 | + - azure_checks is defined |
| 162 | + - azure_checks | length > 0 |
157 | 163 | block: |
158 | 164 | - name: Run Azure-based configuration checks |
159 | 165 | become: true |
|
177 | 183 | msg: "Azure-based configuration checks failed but continuing {{ azure_check_results.msg }}" |
178 | 184 |
|
179 | 185 | - name: "{{ check_type.name }} - Debug the formatted filesystem info from configuration check python module" |
180 | | - when: azure_check_results is defined and azure_check_results.formatted_filesystem_info is defined |
| 186 | + when: |
| 187 | + - azure_check_results is defined |
| 188 | + - azure_check_results.formatted_filesystem_info is defined |
181 | 189 | ansible.builtin.debug: |
182 | 190 | msg: "{{ azure_check_results.formatted_filesystem_info }}" |
183 | 191 | verbosity: 1 |
184 | 192 |
|
185 | 193 | - name: "{{ check_type.name }} - Execute module-based configuration checks" |
186 | | - when: module_checks is defined and module_checks | length > 0 |
| 194 | + when: |
| 195 | + - module_checks is defined |
| 196 | + - module_checks | length > 0 |
187 | 197 | block: |
188 | 198 | - name: Run module-based configuration checks |
189 | 199 | become: true |
|
206 | 216 | msg: "Module-based configuration checks failed but continuing {{ module_check_results.msg }}" |
207 | 217 |
|
208 | 218 | - name: "{{ check_type.name }} - Debug the module check results" |
209 | | - when: module_check_results is defined and module_check_results.check_results is defined |
| 219 | + when: |
| 220 | + - module_check_results is defined |
| 221 | + - module_check_results.check_results is defined |
210 | 222 | ansible.builtin.debug: |
211 | 223 | msg: "Module checks: {{ module_check_results.check_results | length }} results" |
212 | 224 | verbosity: 1 |
|
0 commit comments