updates for audit section

Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
Mark Bolwell 2024-04-15 09:29:19 +01:00
parent f83e73c1a1
commit 05fee15cb4
No known key found for this signature in database
GPG key ID: 1DE02A772D0908F9
5 changed files with 74 additions and 92 deletions

View file

@ -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 }}"