ansible-lint-poc/test-broken.yml

33 lines
864 B
YAML

- name: Test Ansible Lint Formatting
hosts: localhost
connection: local
become: false
gather_facts: false
tasks:
- name: Test Ansible Lint - Ignore Errors
command: ansible-lint --nocolor -f json broken-lint.yml
ignore_errors: true
register: r_lint_output
- name: Debug r_lint_output
debug:
var: r_lint_output['stdout']
- name: Show something
debug:
msg:
- "Lint Check: {{ item['check_name'] }}"
- "Lint Categories: {{ item['categories'] }}"
- "Lint Description: {{ item['description'] }}"
- "Lint Body: {{ item.content['body'] }}"
- "Lint Location: Line #{{ item['location']['lines']['begin'] }} -> {{ item['location']['path'] }}"
loop: "{{ r_lint_output['stdout'] }}"
loop_control:
label: "{{ item['fingerprint'] }}"