-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoscap-scan-and-upload.yml
37 lines (32 loc) · 1.03 KB
/
oscap-scan-and-upload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- name: OpenSCAP Scan and Upload Data
hosts: web
become: True
gather_facts: False
tasks:
- name: Upload scan results to cloud.redhat.com
command: insights-client --compliance
ignore_errors: yes
# - name: OpenSCAP Scan and Upload Data
# hosts: web
# become: True
# gather_facts: False
# vars:
# oscap_profile: xccdf_org.ssgproject.content_profile_standard
# oscap_policy: ssg-rhel7-ds
# scan_results: /tmp/scan.xml
# tasks:
# - name: Clean up any previous scan results
# file:
# name: /tmp/scan.xml
# state: absent
# - name: Run OpenSCAP scan
# command: oscap xccdf eval \
# --profile {{ oscap_profile }} \
# --results {{ scan_results }} \
# /usr/share/xml/scap/ssg/content/{{ oscap_policy }}.xml
# ignore_errors: yes
# - name: Upload scan results to cloud.redhat.com
# command: insights-client \
# --verbose --payload {{ scan_results }} \
# --content-type application/vnd.redhat.compliance.something+tgz