add code to break out warnings and errors and print out the results
This commit is contained in:
parent
9d311793a3
commit
8e3134179b
30
venv.yml
30
venv.yml
@ -90,6 +90,36 @@
|
|||||||
var: r_lint_output['stdout']
|
var: r_lint_output['stdout']
|
||||||
|
|
||||||
|
|
||||||
|
- name: Capture ansible-lint warnings and errors
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
r_lint_warnings: "{{ r_lint_output['stdout'] | from_json | selectattr('level', 'equalto', 'warning') }}"
|
||||||
|
r_lint_failures: "{{ r_lint_output['stdout'] | from_json | selectattr('level', 'equalto', 'error') }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Debug r_lint_warnings
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg:
|
||||||
|
- "File: {{ item['location']['path'] }}"
|
||||||
|
- "Level: {{ item['level'] }}"
|
||||||
|
- "Severity: {{ item['severity'] }}"
|
||||||
|
- "Description: {{ item['description'] }}"
|
||||||
|
loop: "{{ r_lint_warnings }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item['location']['path'] }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Debug r_lint_failures
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg:
|
||||||
|
- "File: {{ item['location']['path'] }}"
|
||||||
|
- "Level: {{ item['level'] }}"
|
||||||
|
- "Severity: {{ item['severity'] }}"
|
||||||
|
- "Description: {{ item['description'] }}"
|
||||||
|
loop: "{{ r_lint_failures }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item['location']['path'] }}"
|
||||||
|
|
||||||
|
|
||||||
- name: Cleanup repository destination
|
- name: Cleanup repository destination
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ lint_work_dir }}"
|
path: "{{ lint_work_dir }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user