Migrated from legacy playbook repo into Ansible collection format: Roles (171 total): - common: 44 roles (fact gathering, SSH setup, utilities) - configuration: 32 roles (system config, networking, satellite) - provisioning: 16 roles (VMware, Azure, physical server deployment) - security: 15 roles (OpenSCAP hardening, certificates, AD integration) - monitoring: 12 roles (Zabbix, logging agents, metrics) - networking: 12 roles (DNS, DHCP, network interfaces) - satellite: 4 roles (Pulp/Satellite management) - misc: 36 roles (various utilities) Playbooks (159 total): - provisioning: 14 playbooks - azure: 13 playbooks - configuration: 22 playbooks - maintenance: 10 playbooks - security: 10 playbooks - monitoring: 9 playbooks - vcenter: 6 playbooks - networking: 7 playbooks - misc: 65 playbooks
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
---
|
|
- hosts: all
|
|
gather_facts: true
|
|
become: true
|
|
pre_tasks:
|
|
- name: Set dc_domain from hostname
|
|
ansible.builtin.set_fact:
|
|
dc_domain: "{{ inventory_hostname | regex_replace('.+?\\.(.+)$', '\\g<1>') | lower }}"
|
|
- name: Remediate OpenSCAP policy
|
|
command: |
|
|
oscap xccdf eval --datastream-id scap_org.open-scap_datastream_from_xccdf_ssg-rhel9-xccdf.xml \
|
|
--xccdf-id scap_org.open-scap_cref_ssg-rhel9-xccdf.xml \
|
|
--tailoring-file /usr/share/xml/scap/skat/ssg-rhel9-ds-tailoring.xml \
|
|
--profile xccdf_org.ssgproject.content_profile_ospp_customized \
|
|
--oval-results \
|
|
--report /tmp/report.html \
|
|
/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
|
|
register: result
|
|
changed_when: result is failed
|
|
#failed_when: false
|
|
|
|
- name:
|
|
ansible.builtin.stat:
|
|
path: /tmp/report.html
|
|
get_attributes: true
|
|
get_checksum: false
|
|
register: file_stat
|
|
|
|
- name: Set report name
|
|
set_fact:
|
|
report_name: "{{ inventory_hostname }}.{{ '%Y-%m-%d.%H:%M:%S'|strftime(file_stat.stat.ctime) }}_no_remediate_review.html"
|
|
|
|
- name: Download report
|
|
fetch:
|
|
src: /tmp/report.html
|
|
dest: /tmp/{{ report_name }}
|
|
flat: true
|
|
|
|
roles:
|
|
- upload-skat-openscap
|