2023-11-21 09:48:49 +00:00
|
|
|
---
|
|
|
|
|
- name: Audit_Only | Create local Directories for hosts
|
|
|
|
|
when: fetch_audit_files
|
2024-07-24 14:01:40 +01:00
|
|
|
ansible.builtin.file:
|
2024-12-11 11:20:00 +00:00
|
|
|
mode: 'u+x,go-w'
|
2024-07-24 14:01:40 +01:00
|
|
|
path: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}"
|
|
|
|
|
recurse: true
|
|
|
|
|
state: directory
|
2023-11-21 09:48:49 +00:00
|
|
|
delegate_to: localhost
|
|
|
|
|
become: false
|
|
|
|
|
|
|
|
|
|
- name: Audit_only | Get audits from systems and put in group dir
|
|
|
|
|
when: fetch_audit_files
|
2024-07-24 14:01:40 +01:00
|
|
|
ansible.builtin.fetch:
|
|
|
|
|
dest: "{{ audit_capture_files_dir }}/{{ inventory_hostname }}/"
|
|
|
|
|
flat: true
|
2024-12-11 11:20:00 +00:00
|
|
|
mode: 'go-wx'
|
2024-07-24 14:01:40 +01:00
|
|
|
src: "{{ pre_audit_outfile }}"
|
2023-11-21 09:48:49 +00:00
|
|
|
|
|
|
|
|
- name: Audit_only | Show Audit Summary
|
2024-12-11 11:20:00 +00:00
|
|
|
when: audit_only
|
2023-11-21 09:48:49 +00:00
|
|
|
ansible.builtin.debug:
|
2024-07-24 14:01:40 +01:00
|
|
|
msg: "{{ audit_results.split('\n') }}"
|
2023-11-21 09:48:49 +00:00
|
|
|
|
|
|
|
|
- name: Audit_only | Stop Playbook Audit Only selected
|
2024-12-11 11:20:00 +00:00
|
|
|
when: audit_only
|
2023-11-21 09:48:49 +00:00
|
|
|
ansible.builtin.meta: end_play
|