mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-27 23:43:06 +00:00
updates for audit section
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
f83e73c1a1
commit
05fee15cb4
5 changed files with 74 additions and 92 deletions
|
|
@ -5,10 +5,10 @@
|
|||
changed_when: true
|
||||
environment:
|
||||
AUDIT_BIN: "{{ audit_bin }}"
|
||||
AUDIT_CONTENT_LOCATION: "{{ audit_out_dir }}"
|
||||
AUDIT_CONTENT_LOCATION: "{{ audit_conf_dest | default('/opt') }}"
|
||||
AUDIT_FILE: goss.yml
|
||||
|
||||
- name: Post Audit | Ensure audit files readable by users
|
||||
- name: Post Audit | ensure audit files readable by users
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
mode: '0644'
|
||||
|
|
@ -21,14 +21,14 @@
|
|||
when:
|
||||
- audit_format == "json"
|
||||
block:
|
||||
- name: Post Audit | Capture data {{ post_audit_outfile }}
|
||||
ansible.builtin.shell: cat {{ post_audit_outfile }}
|
||||
register: discovered_post_audit
|
||||
- name: capture data {{ post_audit_outfile }}
|
||||
ansible.builtin.shell: "cat {{ post_audit_outfile }}"
|
||||
register: post_audit
|
||||
changed_when: false
|
||||
|
||||
- name: Post Audit | Capture post-audit result
|
||||
- name: Capture post-audit result
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_summary: "{{ discovered_post_audit.stdout | from_json | json_query(summary) }}"
|
||||
post_audit_summary: "{{ post_audit.stdout | from_json | json_query(summary) }}"
|
||||
vars:
|
||||
summary: summary."summary-line"
|
||||
|
||||
|
|
@ -36,11 +36,11 @@
|
|||
when:
|
||||
- audit_format == "documentation"
|
||||
block:
|
||||
- name: Post Audit | Capture data {{ post_audit_outfile }}
|
||||
ansible.builtin.shell: tail -2 {{ post_audit_outfile }}
|
||||
register: discovered_post_audit
|
||||
- name: Post Audit | capture data {{ post_audit_outfile }}
|
||||
ansible.builtin.shell: "tail -2 {{ post_audit_outfile }}"
|
||||
register: post_audit
|
||||
changed_when: false
|
||||
|
||||
- name: Post Audit | Capture post-audit result
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_summary: "{{ discovered_post_audit.stdout_lines }}"
|
||||
post_audit_summary: "{{ post_audit.stdout_lines }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue