forked from ansible-lockdown/RHEL9-CIS
section1 v2 initial
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
cf4376f1f7
commit
8b58d71e4b
47 changed files with 2181 additions and 1707 deletions
|
|
@ -4,41 +4,41 @@
|
|||
ansible.builtin.shell: "{{ audit_conf_dir }}/run_audit.sh -v {{ audit_vars_path }} -f {{ audit_format }} -o {{ post_audit_outfile }} -g \"{{ group_names }}\""
|
||||
changed_when: true
|
||||
environment:
|
||||
AUDIT_BIN: "{{ audit_bin }}"
|
||||
AUDIT_CONTENT_LOCATION: "{{ audit_conf_dest | default('/opt') }}"
|
||||
AUDIT_FILE: goss.yml
|
||||
AUDIT_BIN: "{{ audit_bin }}"
|
||||
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'
|
||||
state: file
|
||||
path: "{{ item }}"
|
||||
mode: '0644'
|
||||
state: file
|
||||
loop:
|
||||
- "{{ post_audit_outfile }}"
|
||||
- "{{ pre_audit_outfile }}"
|
||||
- "{{ post_audit_outfile }}"
|
||||
- "{{ pre_audit_outfile }}"
|
||||
|
||||
- name: Post Audit | Capture audit data if json format
|
||||
when:
|
||||
- audit_format == "json"
|
||||
- audit_format == "json"
|
||||
block:
|
||||
- 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: 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: Post Audit | Set Fact for audit summary
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_results: "{{ post_audit_summary.stdout }}"
|
||||
- name: Post Audit | Set Fact for audit summary
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_results: "{{ post_audit_summary.stdout }}"
|
||||
|
||||
- name: Post Audit | Capture audit data if documentation format
|
||||
when:
|
||||
- audit_format == "documentation"
|
||||
- audit_format == "documentation"
|
||||
block:
|
||||
- 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 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 | Set Fact for audit summary
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_results: "{{ post_audit_summary.stdout }}"
|
||||
- name: Post Audit | Set Fact for audit summary
|
||||
ansible.builtin.set_fact:
|
||||
post_audit_results: "{{ post_audit_summary.stdout }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue