mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-24 22:23:06 +00:00
update audit output and remove jmespath
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
7dcb2cae1c
commit
54e4ee1588
3 changed files with 24 additions and 27 deletions
|
|
@ -21,26 +21,24 @@
|
|||
when:
|
||||
- audit_format == "json"
|
||||
block:
|
||||
- name: capture data {{ post_audit_outfile }}
|
||||
ansible.builtin.shell: "cat {{ post_audit_outfile }}"
|
||||
register: post_audit
|
||||
- name: Post Audit | Capture audit data if json format
|
||||
ansible.builtin.shell: grep -E '"summary-line.*Count:.*Failed' "{{ post_audit_outfile }}" | cut -d'"' -f4
|
||||
register: post_audit_summary
|
||||
changed_when: false
|
||||
|
||||
- name: Capture post-audit result
|
||||
- name: Post Audit | Set Fact for audit summary
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_summary: "{{ post_audit.stdout | from_json | json_query(summary) }}"
|
||||
vars:
|
||||
summary: summary."summary-line"
|
||||
post_audit_results: "{{ post_audit_summary.stdout }}"
|
||||
|
||||
- name: Post Audit | Capture audit data if documentation format
|
||||
when:
|
||||
- audit_format == "documentation"
|
||||
block:
|
||||
- name: Post Audit | capture data {{ post_audit_outfile }}
|
||||
ansible.builtin.shell: "tail -2 {{ post_audit_outfile }}"
|
||||
register: post_audit
|
||||
- name: Post Audit | Capture audit data if documentation format
|
||||
ansible.builtin.shell: "tail -2 /opt/audit_ubuntu2204-CIS-UBUNTU22_1720624848.documentation"
|
||||
register: post_audit_summary
|
||||
changed_when: false
|
||||
|
||||
- name: Post Audit | Capture post-audit result
|
||||
- name: Post Audit | Set Fact for audit summary
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_summary: "{{ post_audit.stdout_lines }}"
|
||||
post_audit_results: "{{ post_audit_summary.stdout }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue